Mercurial > vim
diff src/if_py_both.h @ 17168:1d30eb64a7a2 v8.1.1583
patch 8.1.1583: set_ref_in_list() only sets ref in items
commit https://github.com/vim/vim/commit/7be3ab25891fec711d8a2d9d242711a9155852b6
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jun 23 01:46:15 2019 +0200
patch 8.1.1583: set_ref_in_list() only sets ref in items
Problem: Set_ref_in_list() only sets ref in items.
Solution: Rename to set_ref_in_list_items() to avoid confusion.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 23 Jun 2019 02:00:06 +0200 |
parents | ce04ebdf26b8 |
children | 4d63d47d87ef |
line wrap: on
line diff
--- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -5832,23 +5832,16 @@ run_eval(const char *cmd, typval_T *rett set_ref_in_py(const int copyID) { pylinkedlist_T *cur; - dict_T *dd; - list_T *ll; - int i; - int abort = FALSE; + list_T *ll; + int i; + int abort = FALSE; FunctionObject *func; if (lastdict != NULL) { for (cur = lastdict ; !abort && cur != NULL ; cur = cur->pll_prev) - { - dd = ((DictionaryObject *) (cur->pll_obj))->dict; - if (dd->dv_copyID != copyID) - { - dd->dv_copyID = copyID; - abort = abort || set_ref_in_ht(&dd->dv_hashtab, copyID, NULL); - } - } + abort = set_ref_in_dict(((DictionaryObject *)(cur->pll_obj))->dict, + copyID); } if (lastlist != NULL) @@ -5856,11 +5849,7 @@ set_ref_in_py(const int copyID) for (cur = lastlist ; !abort && cur != NULL ; cur = cur->pll_prev) { ll = ((ListObject *) (cur->pll_obj))->list; - if (ll->lv_copyID != copyID) - { - ll->lv_copyID = copyID; - abort = abort || set_ref_in_list(ll, copyID, NULL); - } + abort = set_ref_in_list(ll, copyID); } } @@ -5869,12 +5858,7 @@ set_ref_in_py(const int copyID) for (cur = lastfunc ; !abort && cur != NULL ; cur = cur->pll_prev) { func = (FunctionObject *) cur->pll_obj; - if (func->self != NULL && func->self->dv_copyID != copyID) - { - func->self->dv_copyID = copyID; - abort = abort || set_ref_in_ht( - &func->self->dv_hashtab, copyID, NULL); - } + abort = set_ref_in_dict(func->self, copyID); if (func->argc) for (i = 0; !abort && i < func->argc; ++i) abort = abort