src/kv_list.c

changeset 1394
7b23c6db9500
parent 1393
461d256e32c6
equal deleted inserted replaced
1393:461d256e32c6 1394:7b23c6db9500
647 // but don't free the key data (that was done by the map remove) 647 // but don't free the key data (that was done by the map remove)
648 memset(loc_key, 0, sizeof(CxHashKey)); 648 memset(loc_key, 0, sizeof(CxHashKey));
649 return 0; 649 return 0;
650 } 650 }
651 651
652 const CxHashKey *cxKvListGetKey(CxList *list, size_t index) {
653 cx_kv_list *kv_list = (cx_kv_list*)list;
654 void *node_data = kv_list->list_methods->at(list, index);
655 if (node_data == NULL) {
656 return NULL;
657 }
658 CxHashKey *key = cx_kv_list_loc_key(kv_list, node_data);
659 if (key->hash == 0) {
660 return NULL;
661 }
662 return key;
663 }
664
652 int cx_kv_list_insert(CxList *list, size_t index, CxHashKey key, void *value) { 665 int cx_kv_list_insert(CxList *list, size_t index, CxHashKey key, void *value) {
653 // assume we are losing the sorted property 666 // assume we are losing the sorted property
654 list->collection.sorted = false; 667 list->collection.sorted = false;
655 668
656 cx_kv_list *kv_list = (cx_kv_list*)list; 669 cx_kv_list *kv_list = (cx_kv_list*)list;

mercurial