aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-07-05 15:20:02 +0800
committerGitHub <noreply@github.com>2024-07-05 15:20:02 +0800
commit2a883d9c597e70d25ffc53373731d05d18a89b91 (patch)
tree8a6ab16a1d9ff24d4660fe11f602aee43a265d29 /src/nvim/eval.c
parent3e6cec0befd41d37ee36cb4f602e84c58c5f0d27 (diff)
downloadrneovim-2a883d9c597e70d25ffc53373731d05d18a89b91.tar.gz
rneovim-2a883d9c597e70d25ffc53373731d05d18a89b91.tar.bz2
rneovim-2a883d9c597e70d25ffc53373731d05d18a89b91.zip
vim-patch:9.1.0524: the recursive parameter in the *_equal functions can be removed (#29572)
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: vim/vim#15070 https://github.com/vim/vim/commit/7ccd1a2e858dbb2ac7fb09971dfcbfad62baa677 Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r--src/nvim/eval.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index b541af23af..247948ffe9 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -4387,7 +4387,7 @@ bool func_equal(typval_T *tv1, typval_T *tv2, bool ic)
if (d1 != d2) {
return false;
}
- } else if (!tv_dict_equal(d1, d2, ic, true)) {
+ } else if (!tv_dict_equal(d1, d2, ic)) {
return false;
}
@@ -4399,7 +4399,7 @@ bool func_equal(typval_T *tv1, typval_T *tv2, bool ic)
}
for (int i = 0; i < a1; i++) {
if (!tv_equal(tv1->vval.v_partial->pt_argv + i,
- tv2->vval.v_partial->pt_argv + i, ic, true)) {
+ tv2->vval.v_partial->pt_argv + i, ic)) {
return false;
}
}
@@ -9063,7 +9063,7 @@ int typval_compare(typval_T *typ1, typval_T *typ2, exprtype_T type, bool ic)
return FAIL;
} else {
// Compare two Lists for being equal or unequal.
- n1 = tv_list_equal(typ1->vval.v_list, typ2->vval.v_list, ic, false);
+ n1 = tv_list_equal(typ1->vval.v_list, typ2->vval.v_list, ic);
if (type == EXPR_NEQUAL) {
n1 = !n1;
}
@@ -9086,7 +9086,7 @@ int typval_compare(typval_T *typ1, typval_T *typ2, exprtype_T type, bool ic)
return FAIL;
} else {
// Compare two Dictionaries for being equal or unequal.
- n1 = tv_dict_equal(typ1->vval.v_dict, typ2->vval.v_dict, ic, false);
+ n1 = tv_dict_equal(typ1->vval.v_dict, typ2->vval.v_dict, ic);
if (type == EXPR_NEQUAL) {
n1 = !n1;
}
@@ -9107,14 +9107,14 @@ int typval_compare(typval_T *typ1, typval_T *typ2, exprtype_T type, bool ic)
if (typ1->v_type == VAR_FUNC && typ2->v_type == VAR_FUNC) {
// strings are considered the same if their value is
// the same
- n1 = tv_equal(typ1, typ2, ic, false);
+ n1 = tv_equal(typ1, typ2, ic);
} else if (typ1->v_type == VAR_PARTIAL && typ2->v_type == VAR_PARTIAL) {
n1 = typ1->vval.v_partial == typ2->vval.v_partial;
} else {
n1 = false;
}
} else {
- n1 = tv_equal(typ1, typ2, ic, false);
+ n1 = tv_equal(typ1, typ2, ic);
}
if (type == EXPR_NEQUAL || type == EXPR_ISNOT) {
n1 = !n1;