patch 9.1.0524: the recursive parameter in the *_equal functions can be removed
Problem: the recursive parameter in the *_equal functions can be removed
Solution: Remove the recursive parameter in dict_equal(), list_equal()
object_equal and tv_equal(). Use a comparison of the static
var recursive_cnt == 0 to determine whether or not tv_equal()
has been called recursively (Yinzuo Jiang).
closes: #15070
Signed-off-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/list.c b/src/list.c
index 9479b4b..36ce494 100644
--- a/src/list.c
+++ b/src/list.c
@@ -365,8 +365,7 @@
list_equal(
list_T *l1,
list_T *l2,
- int ic, // ignore case for strings
- int recursive) // TRUE when used recursively
+ int ic) // ignore case for strings
{
listitem_T *item1, *item2;
@@ -386,7 +385,7 @@
for (item1 = l1->lv_first, item2 = l2->lv_first;
item1 != NULL && item2 != NULL;
item1 = item1->li_next, item2 = item2->li_next)
- if (!tv_equal(&item1->li_tv, &item2->li_tv, ic, recursive))
+ if (!tv_equal(&item1->li_tv, &item2->li_tv, ic))
return FALSE;
return item1 == NULL && item2 == NULL;
}
@@ -2727,7 +2726,7 @@
}
for ( ; li != NULL; li = li->li_next)
- if (tv_equal(&li->li_tv, needle, ic, FALSE))
+ if (tv_equal(&li->li_tv, needle, ic))
++n;
return n;