aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/context.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-04-18 21:40:14 +0200
committerGitHub <noreply@github.com>2022-04-18 21:40:14 +0200
commitd3121f1e6380822fcc284ba374b5854c655a1dc4 (patch)
tree8f2e1dca03bc71f8b71ab972dc7dacfe12c03386 /src/nvim/context.c
parente73ef5c09281fa45ce6b0a0959467722af2840e8 (diff)
parent0fb571e3b5043f136f2394d84b942b8c93fdde45 (diff)
downloadrneovim-d3121f1e6380822fcc284ba374b5854c655a1dc4.tar.gz
rneovim-d3121f1e6380822fcc284ba374b5854c655a1dc4.tar.bz2
rneovim-d3121f1e6380822fcc284ba374b5854c655a1dc4.zip
Merge pull request #18091 from dundargoc/refactor/pure-attribute
refactor: add pure attribute to pure functions
Diffstat (limited to 'src/nvim/context.c')
-rw-r--r--src/nvim/context.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nvim/context.c b/src/nvim/context.c
index 9434b4e0ea..c30a05a3c8 100644
--- a/src/nvim/context.c
+++ b/src/nvim/context.c
@@ -33,6 +33,7 @@ void ctx_free_all(void)
/// Returns the size of the context stack.
size_t ctx_size(void)
+ FUNC_ATTR_PURE
{
return kv_size(ctx_stack);
}
@@ -40,6 +41,7 @@ size_t ctx_size(void)
/// Returns pointer to Context object with given zero-based index from the top
/// of context stack or NULL if index is out of bounds.
Context *ctx_get(size_t index)
+ FUNC_ATTR_PURE
{
if (index < kv_size(ctx_stack)) {
return &kv_Z(ctx_stack, index);