src/kv_list.c

changeset 1618
ef7cab6eb131
parent 1605
55b13f583356
--- a/src/kv_list.c	Tue Dec 16 21:33:58 2025 +0100
+++ b/src/kv_list.c	Wed Dec 17 19:05:50 2025 +0100
@@ -221,11 +221,12 @@
 
     size_t index;
     cx_linked_list *ll = &kv_list->list;
-    char *node = cx_linked_list_find(
+    char *node = cx_linked_list_find_c(
             ll->begin,
             ll->loc_next, ll->loc_data,
-            list->collection.cmpfunc, elem,
-            &index
+            elem, &index,
+            cx_list_compare_wrapper,
+            list
     );
     if (node == NULL) {
         return list->collection.size;
@@ -599,13 +600,8 @@
     // remember the base methods and override them
     kv_list->map_methods = map->cl;
     map->cl = &cx_kv_map_class;
-    if (list->climpl == NULL) {
-        kv_list->list_methods = list->cl;
-        list->cl = &cx_kv_list_class;
-    } else {
-        kv_list->list_methods = list->climpl;
-        list->climpl = &cx_kv_list_class;
-    }
+    kv_list->list_methods = list->cl;
+    list->cl = &cx_kv_list_class;
 
     return list;
 }

mercurial