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

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>
This commit is contained in:
Yinzuo Jiang
2024-07-04 17:20:53 +02:00
committed by Christian Brabandt
parent e54fd3f7d8
commit 7ccd1a2e85
12 changed files with 43 additions and 33 deletions

View File

@@ -3849,8 +3849,7 @@ object_len(object_T *obj)
object_equal(
object_T *o1,
object_T *o2,
int ic, // ignore case for strings
int recursive) // TRUE when used recursively
int ic) // ignore case for strings
{
class_T *cl1, *cl2;
@@ -3866,7 +3865,7 @@ object_equal(
return FALSE;
for (int i = 0; i < cl1->class_obj_member_count; ++i)
if (!tv_equal((typval_T *)(o1 + 1) + i, (typval_T *)(o2 + 1) + i, ic, recursive))
if (!tv_equal((typval_T *)(o1 + 1) + i, (typval_T *)(o2 + 1) + i, ic))
return FALSE;
return TRUE;