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/testing.c b/src/testing.c
index 3e9e077..18b8e78 100644
--- a/src/testing.c
+++ b/src/testing.c
@@ -187,7 +187,7 @@
{
item2 = dict_find(got_d, hi->hi_key, -1);
if (item2 == NULL || !tv_equal(&HI2DI(hi)->di_tv,
- &item2->di_tv, FALSE, FALSE))
+ &item2->di_tv, FALSE))
{
// item of exp_d not present in got_d or values differ.
dict_add_tv(exp_tv->vval.v_dict,
@@ -262,7 +262,7 @@
{
garray_T ga;
- if (tv_equal(&argvars[0], &argvars[1], FALSE, FALSE)
+ if (tv_equal(&argvars[0], &argvars[1], FALSE)
!= (atype == ASSERT_EQUAL))
{
prepare_assert_error(&ga);