0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 8.2.4683: verbose check with dict_find() to see if a key is present

Problem:    Verbose check with dict_find() to see if a key is present.
Solution:   Add dict_has_key(). (Yegappan Lakshmanan, closes #10074)
This commit is contained in:
Yegappan Lakshmanan
2022-04-04 15:16:54 +01:00
committed by Bram Moolenaar
parent 7a411a306f
commit 4829c1c9e9
18 changed files with 95 additions and 84 deletions

View File

@@ -1605,7 +1605,7 @@ readdirex_dict_arg(typval_T *tv, int *cmp)
return FAIL;
}
if (dict_find(tv->vval.v_dict, (char_u *)"sort", -1) != NULL)
if (dict_has_key(tv->vval.v_dict, "sort"))
compare = dict_get_string(tv->vval.v_dict, (char_u *)"sort", FALSE);
else
{