src/kv_list.c

changeset 1397
a5c7d63b064d
parent 1394
7b23c6db9500
equal deleted inserted replaced
1396:533ed620fd73 1397:a5c7d63b064d
312 *map_data = node_data; 312 *map_data = node_data;
313 313
314 // copy the key to the node data 314 // copy the key to the node data
315 CxHashKey *key_ptr = cx_kv_list_loc_key(kv_list, node_data); 315 CxHashKey *key_ptr = cx_kv_list_loc_key(kv_list, node_data);
316 *key_ptr = key; 316 *key_ptr = key;
317 return map_data; 317
318 // we must return node_data here and not map_data,
319 // because the node_data is the actual element of this collection
320 return node_data;
318 } 321 }
319 322
320 void *cx_kvl_map_get(const CxMap *map, CxHashKey key) { 323 void *cx_kvl_map_get(const CxMap *map, CxHashKey key) {
321 cx_kv_list *kv_list = ((struct cx_kv_list_map_s*)map)->list; 324 cx_kv_list *kv_list = ((struct cx_kv_list_map_s*)map)->list;
322 void *node_data = kv_list->map_methods->get(map, key); 325 void *node_data = kv_list->map_methods->get(map, key);

mercurial