aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testing.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/testing.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/testing.c')
-rw-r--r--src/nvim/testing.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/nvim/testing.c b/src/nvim/testing.c
index 8041cc2e33..4dc8984fa9 100644
--- a/src/nvim/testing.c
+++ b/src/nvim/testing.c
@@ -198,7 +198,7 @@ static void fill_assert_error(garray_T *gap, typval_T *opt_msg_tv, const char *e
if (!HASHITEM_EMPTY(hi)) {
dictitem_T *item2 = tv_dict_find(got_d, hi->hi_key, -1);
if (item2 == NULL
- || !tv_equal(&TV_DICT_HI2DI(hi)->di_tv, &item2->di_tv, false, false)) {
+ || !tv_equal(&TV_DICT_HI2DI(hi)->di_tv, &item2->di_tv, false)) {
// item of exp_d not present in got_d or values differ.
const size_t key_len = strlen(hi->hi_key);
tv_dict_add_tv(exp_tv->vval.v_dict, hi->hi_key, key_len, &TV_DICT_HI2DI(hi)->di_tv);
@@ -271,8 +271,7 @@ static int assert_equal_common(typval_T *argvars, assert_type_T atype)
{
garray_T ga;
- if (tv_equal(&argvars[0], &argvars[1], false, false)
- != (atype == ASSERT_EQUAL)) {
+ if (tv_equal(&argvars[0], &argvars[1], false) != (atype == ASSERT_EQUAL)) {
prepare_assert_error(&ga);
fill_assert_error(&ga, &argvars[2], NULL,
&argvars[0], &argvars[1], atype);