From 7be3ab25891fec711d8a2d9d242711a9155852b6 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 23 Jun 2019 01:46:15 +0200 Subject: 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. --- src/if_py_both.h | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) (limited to 'src/if_py_both.h') diff --git a/src/if_py_both.h b/src/if_py_both.h index 5362d45636..d836c7c91b 100644 --- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -5832,23 +5832,16 @@ run_eval(const char *cmd, typval_T *rettv 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 -- cgit v1.2.3