src/json.c

changeset 1605
55b13f583356
parent 1602
7329821fd768
child 1607
0ecb13118cac
--- a/src/json.c	Sun Dec 14 16:21:09 2025 +0100
+++ b/src/json.c	Sun Dec 14 17:30:17 2025 +0100
@@ -453,11 +453,10 @@
 }
 
 static CxJsonObject json_create_object_map(const CxAllocator *allocator) {
-    CxMap *map = cxKvListCreateAsMap(allocator, (cx_compare_func) cxJsonCompare, CX_STORE_POINTERS);
+    CxMap *map = cxKvListCreateAsMap(allocator, CX_STORE_POINTERS);
     if (map == NULL) return NULL; // LCOV_EXCL_LINE
-    // TODO: fix the specification of the compare function
-    map->collection.cmpfunc = (cx_compare_func) cxJsonCompare;
-    cxDefineDestructor(map, cxJsonValueFree);
+    cxSetCompareFunc(map, cxJsonCompare);
+    cxSetDestructor(map, cxJsonValueFree);
     return map;
 }
 

mercurial