summaryrefslogtreecommitdiffstats
path: root/src/json.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2022-04-04 15:16:54 +0100
committerBram Moolenaar <Bram@vim.org>2022-04-04 15:16:54 +0100
commit4829c1c9e9095a3303caec9af7d02f6547f6df0e (patch)
tree2b3819cd2ea17b652ba29f3a8a6ea9945ec6c4bb /src/json.c
parent7a411a306f90339d8686e42ac16e1ae4fc7533c5 (diff)
patch 8.2.4683: verbose check with dict_find() to see if a key is presentv8.2.4683
Problem: Verbose check with dict_find() to see if a key is present. Solution: Add dict_has_key(). (Yegappan Lakshmanan, closes #10074)
Diffstat (limited to 'src/json.c')
-rw-r--r--src/json.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/json.c b/src/json.c
index b23bfa0895..5be8f7fe66 100644
--- a/src/json.c
+++ b/src/json.c
@@ -1027,8 +1027,8 @@ item_end:
case JSON_OBJECT:
if (cur_item != NULL
- && dict_find(top_item->jd_tv.vval.v_dict,
- top_item->jd_key, -1) != NULL)
+ && dict_has_key(top_item->jd_tv.vval.v_dict,
+ (char *)top_item->jd_key))
{
semsg(_(e_duplicate_key_in_json_str), top_item->jd_key);
clear_tv(cur_item);