src/kv_list.c

changeset 1394
7b23c6db9500
parent 1393
461d256e32c6
--- a/src/kv_list.c	Wed Sep 24 23:52:36 2025 +0200
+++ b/src/kv_list.c	Thu Sep 25 14:30:28 2025 +0200
@@ -649,6 +649,19 @@
     return 0;
 }
 
+const CxHashKey *cxKvListGetKey(CxList *list, size_t index) {
+    cx_kv_list *kv_list = (cx_kv_list*)list;
+    void *node_data = kv_list->list_methods->at(list, index);
+    if (node_data == NULL) {
+        return NULL;
+    }
+    CxHashKey *key = cx_kv_list_loc_key(kv_list, node_data);
+    if (key->hash == 0) {
+        return NULL;
+    }
+    return key;
+}
+
 int cx_kv_list_insert(CxList *list, size_t index, CxHashKey key, void *value) {
     // assume we are losing the sorted property
     list->collection.sorted = false;

mercurial