src/map.c

changeset 1587
7156d6699410
parent 1579
0393c67556ec
equal deleted inserted replaced
1586:7f1cadc3ebc1 1587:7156d6699410
108 if (map == NULL) map = cxEmptyMap; 108 if (map == NULL) map = cxEmptyMap;
109 return map->cl->iterator(map, CX_MAP_ITERATOR_PAIRS); 109 return map->cl->iterator(map, CX_MAP_ITERATOR_PAIRS);
110 } 110 }
111 111
112 int cx_map_put(CxMap *map, CxHashKey key, void *value) { 112 int cx_map_put(CxMap *map, CxHashKey key, void *value) {
113 return map->cl->put(map, key, value) == NULL; 113 return map->cl->put(map, key, value).key == NULL;
114 } 114 }
115 115
116 void *cx_map_emplace(CxMap *map, CxHashKey key) { 116 void *cx_map_emplace(CxMap *map, CxHashKey key) {
117 return map->cl->put(map, key, NULL); 117 return map->cl->put(map, key, NULL).value;
118 } 118 }
119 119
120 void *cx_map_get(const CxMap *map, CxHashKey key) { 120 void *cx_map_get(const CxMap *map, CxHashKey key) {
121 return map->cl->get(map, key); 121 return map->cl->get(map, key);
122 } 122 }

mercurial