Mercurial > vim
comparison src/eval.c @ 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 | ebe9aab81898 |
children | 6990c1160ea5 |
comparison
equal
deleted
inserted
replaced
17167:3a799cd410d4 | 17168:1d30eb64a7a2 |
---|---|
5839 | 5839 |
5840 return abort; | 5840 return abort; |
5841 } | 5841 } |
5842 | 5842 |
5843 /* | 5843 /* |
5844 * Mark a dict and its items with "copyID". | |
5845 * Returns TRUE if setting references failed somehow. | |
5846 */ | |
5847 int | |
5848 set_ref_in_dict(dict_T *d, int copyID) | |
5849 { | |
5850 if (d != NULL && d->dv_copyID != copyID) | |
5851 { | |
5852 d->dv_copyID = copyID; | |
5853 return set_ref_in_ht(&d->dv_hashtab, copyID, NULL); | |
5854 } | |
5855 return FALSE; | |
5856 } | |
5857 | |
5858 /* | |
5859 * Mark a list and its items with "copyID". | |
5860 * Returns TRUE if setting references failed somehow. | |
5861 */ | |
5862 int | |
5863 set_ref_in_list(list_T *ll, int copyID) | |
5864 { | |
5865 if (ll != NULL && ll->lv_copyID != copyID) | |
5866 { | |
5867 ll->lv_copyID = copyID; | |
5868 return set_ref_in_list_items(ll, copyID, NULL); | |
5869 } | |
5870 return FALSE; | |
5871 } | |
5872 | |
5873 /* | |
5844 * Mark all lists and dicts referenced through list "l" with "copyID". | 5874 * Mark all lists and dicts referenced through list "l" with "copyID". |
5845 * "ht_stack" is used to add hashtabs to be marked. Can be NULL. | 5875 * "ht_stack" is used to add hashtabs to be marked. Can be NULL. |
5846 * | 5876 * |
5847 * Returns TRUE if setting references failed somehow. | 5877 * Returns TRUE if setting references failed somehow. |
5848 */ | 5878 */ |
5849 int | 5879 int |
5850 set_ref_in_list(list_T *l, int copyID, ht_stack_T **ht_stack) | 5880 set_ref_in_list_items(list_T *l, int copyID, ht_stack_T **ht_stack) |
5851 { | 5881 { |
5852 listitem_T *li; | 5882 listitem_T *li; |
5853 int abort = FALSE; | 5883 int abort = FALSE; |
5854 list_T *cur_l; | 5884 list_T *cur_l; |
5855 list_stack_T *list_stack = NULL; | 5885 list_stack_T *list_stack = NULL; |
5928 { | 5958 { |
5929 /* Didn't see this list yet. */ | 5959 /* Didn't see this list yet. */ |
5930 ll->lv_copyID = copyID; | 5960 ll->lv_copyID = copyID; |
5931 if (list_stack == NULL) | 5961 if (list_stack == NULL) |
5932 { | 5962 { |
5933 abort = set_ref_in_list(ll, copyID, ht_stack); | 5963 abort = set_ref_in_list_items(ll, copyID, ht_stack); |
5934 } | 5964 } |
5935 else | 5965 else |
5936 { | 5966 { |
5937 list_stack_T *newitem = (list_stack_T*)malloc( | 5967 list_stack_T *newitem = (list_stack_T*)malloc( |
5938 sizeof(list_stack_T)); | 5968 sizeof(list_stack_T)); |