From 831eb2a9bf9fdffc1b6942e4c43bc2458f4af794 Mon Sep 17 00:00:00 2001 From: Michael Ennen Date: Thu, 30 Mar 2017 16:07:39 -0700 Subject: vim-patch:7.4.2104 (#6332) Problem: Code duplication when unreferencing a function. Solution: De-duplicate. https://github.com/vim/vim/commit/97baee80f0906ee2f651ee1215ec033e84f866ad --- src/nvim/eval.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/nvim/eval.c') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 80c2fe10d7..a83e93090a 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -20711,13 +20711,7 @@ void func_unref(char_u *name) abort(); #endif } - if (fp != NULL && --fp->uf_refcount <= 0) { - // Only delete it when it's not being used. Otherwise it's done - // when "uf_calls" becomes zero. - if (fp->uf_calls == 0) { - func_clear_free(fp, false); - } - } + func_ptr_unref(fp); } /// Unreference a Function: decrement the reference count and free it when it -- cgit