0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

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.
This commit is contained in:
Bram Moolenaar
2019-06-23 01:46:15 +02:00
parent 0fcf26ba4f
commit 7be3ab2589
7 changed files with 50 additions and 48 deletions

View File

@@ -5840,6 +5840,36 @@ set_ref_in_ht(hashtab_T *ht, int copyID, list_stack_T **list_stack)
return abort;
}
/*
* Mark a dict and its items with "copyID".
* Returns TRUE if setting references failed somehow.
*/
int
set_ref_in_dict(dict_T *d, int copyID)
{
if (d != NULL && d->dv_copyID != copyID)
{
d->dv_copyID = copyID;
return set_ref_in_ht(&d->dv_hashtab, copyID, NULL);
}
return FALSE;
}
/*
* Mark a list and its items with "copyID".
* Returns TRUE if setting references failed somehow.
*/
int
set_ref_in_list(list_T *ll, int copyID)
{
if (ll != NULL && ll->lv_copyID != copyID)
{
ll->lv_copyID = copyID;
return set_ref_in_list_items(ll, copyID, NULL);
}
return FALSE;
}
/*
* Mark all lists and dicts referenced through list "l" with "copyID".
* "ht_stack" is used to add hashtabs to be marked. Can be NULL.
@@ -5847,7 +5877,7 @@ set_ref_in_ht(hashtab_T *ht, int copyID, list_stack_T **list_stack)
* Returns TRUE if setting references failed somehow.
*/
int
set_ref_in_list(list_T *l, int copyID, ht_stack_T **ht_stack)
set_ref_in_list_items(list_T *l, int copyID, ht_stack_T **ht_stack)
{
listitem_T *li;
int abort = FALSE;
@@ -5930,7 +5960,7 @@ set_ref_in_item(
ll->lv_copyID = copyID;
if (list_stack == NULL)
{
abort = set_ref_in_list(ll, copyID, ht_stack);
abort = set_ref_in_list_items(ll, copyID, ht_stack);
}
else
{