From 0fb571e3b5043f136f2394d84b942b8c93fdde45 Mon Sep 17 00:00:00 2001 From: Dundar Göc Date: Mon, 11 Apr 2022 18:29:48 +0200 Subject: refactor: add pure attribute to pure functions This will allow compilers that support the pure attribute to make further optimizations to functions. --- src/nvim/context.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/nvim/context.c') 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); -- cgit