src/json.c

changeset 1429
6e0c3a8a914a
parent 1426
3a89b31f0724
--- a/src/json.c	Fri Oct 17 15:04:56 2025 +0200
+++ b/src/json.c	Fri Oct 17 16:53:24 2025 +0200
@@ -1163,7 +1163,8 @@
 CxIterator cxJsonArrIter(const CxJsonValue *value) {
     return cxIteratorPtr(
         value->value.array.array,
-        value->value.array.array_size
+        value->value.array.array_size,
+        true // arrays need to keep order
     );
 }
 
@@ -1171,7 +1172,8 @@
     return cxIterator(
         value->value.object.values,
         sizeof(CxJsonObjValue),
-        value->value.object.values_size
+        value->value.object.values_size,
+        true // TODO: objects do not always need to keep order
     );
 }
 
@@ -1191,7 +1193,7 @@
     } else {
         CxJsonObjValue kv = value->value.object.values[index];
         cx_strfree_a(value->allocator, &kv.name);
-        // TODO: replace with cx_array_remove()
+        // TODO: replace with cx_array_remove() / cx_array_remove_fast()
         value->value.object.values_size--;
         memmove(value->value.object.values + index, value->value.object.values + index + 1, (value->value.object.values_size - index) * sizeof(CxJsonObjValue));
         return kv.value;

mercurial