From 2977af835ce0172b22e91b940385a67bf6c127e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 2 Jan 2019 12:14:23 +0100 Subject: [PATCH] yml: add TODO to handle duplicate keys when merging dictionaries --- yml.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/yml.c b/yml.c index e7d7864..875cd06 100644 --- a/yml.c +++ b/yml.c @@ -211,6 +211,11 @@ post_process(struct yml_node *node) .key = vv_it->item.key, .value = vv_it->item.value, }; + /* TODO: handle this. Is it an error? Or + * should we replace the existing key/value + * pair */ + assert(!dict_has_key(node, vv_it->item.key)); + tll_push_back(node->dict.pairs, p); } @@ -232,6 +237,11 @@ post_process(struct yml_node *node) .key = v_it->item.key, .value = v_it->item.value, }; + + /* TODO: handle this. Is it an error? Or should we + * replace the existing key/value pair */ + assert(!dict_has_key(node, v_it->item.key)); + tll_push_back(node->dict.pairs, p); }