mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:7.4.2104
Problem: Code duplication when unreferencing a function.
Solution: De-duplicate.
97baee80f0
This commit is contained in:
parent
cbaa87a639
commit
6563d85990
@ -21960,11 +21960,12 @@ static void func_free(ufunc_T *fp)
|
||||
*/
|
||||
void func_unref(char_u *name)
|
||||
{
|
||||
ufunc_T *fp;
|
||||
ufunc_T *fp = NULL;
|
||||
|
||||
if (name == NULL) {
|
||||
return;
|
||||
} else if (isdigit(*name)) {
|
||||
}
|
||||
if (isdigit(*name)) {
|
||||
fp = find_func(name);
|
||||
if (fp == NULL) {
|
||||
#ifdef EXITFREE
|
||||
@ -21980,6 +21981,7 @@ void func_unref(char_u *name)
|
||||
} else if (STRNCMP(name, "<lambda>", 8) == 0) {
|
||||
// fail silently, when lambda function isn't found
|
||||
fp = find_func(name);
|
||||
}
|
||||
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.
|
||||
@ -21987,7 +21989,6 @@ void func_unref(char_u *name)
|
||||
func_free(fp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void user_func_unref(ufunc_T *fp)
|
||||
|
Loading…
Reference in New Issue
Block a user