diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-06-23 01:46:15 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-06-23 01:46:15 +0200 |
commit | 7be3ab25891fec711d8a2d9d242711a9155852b6 (patch) | |
tree | 3dab3f000e881253f5ca0961ea13b8abc2a0d39d /src/if_lua.c | |
parent | 0fcf26ba4ffaaa6a2fb8d879dc24b5f7e1bb6a13 (diff) | |
download | vim-git-7be3ab25891fec711d8a2d9d242711a9155852b6.tar.gz |
patch 8.1.1583: set_ref_in_list() only sets ref in itemsv8.1.1583
Problem: Set_ref_in_list() only sets ref in items.
Solution: Rename to set_ref_in_list_items() to avoid confusion.
Diffstat (limited to 'src/if_lua.c')
-rw-r--r-- | src/if_lua.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/src/if_lua.c b/src/if_lua.c index cfb288522..4c0eb42a4 100644 --- a/src/if_lua.c +++ b/src/if_lua.c @@ -1980,31 +1980,19 @@ luaV_setref(lua_State *L) { list_T *l = (list_T *)lua_touserdata(L, 5); // key - if (l->lv_copyID != copyID) - { - l->lv_copyID = copyID; - abort = set_ref_in_list(l, copyID, NULL); - } + abort = set_ref_in_list(l, copyID); } else if (lua_rawequal(L, -1, 3)) // dict? { dict_T *d = (dict_T *)lua_touserdata(L, 5); // key - if (d->dv_copyID != copyID) - { - d->dv_copyID = copyID; - abort = set_ref_in_ht(&d->dv_hashtab, copyID, NULL); - } + abort = set_ref_in_dict(d, copyID); } else if (lua_rawequal(L, -1, 4)) // funcref? { luaV_Funcref *f = (luaV_Funcref *)lua_touserdata(L, 5); // key - if (f->self != NULL && f->self->dv_copyID != copyID) - { - f->self->dv_copyID = copyID; - abort = set_ref_in_ht(&f->self->dv_hashtab, copyID, NULL); - } + abort = set_ref_in_dict(f->self, copyID); } lua_pop(L, 2); // metatable and value } |