src/kv_list.c

changeset 1397
a5c7d63b064d
parent 1394
7b23c6db9500
--- a/src/kv_list.c	Thu Sep 25 14:49:48 2025 +0200
+++ b/src/kv_list.c	Fri Sep 26 22:43:17 2025 +0200
@@ -314,7 +314,10 @@
     // copy the key to the node data
     CxHashKey *key_ptr = cx_kv_list_loc_key(kv_list, node_data);
     *key_ptr = key;
-    return map_data;
+
+    // we must return node_data here and not map_data,
+    // because the node_data is the actual element of this collection
+    return node_data;
 }
 
 void *cx_kvl_map_get(const CxMap *map, CxHashKey key) {

mercurial