ucx/map.c

changeset 168
6db9c5d7d7ff
parent 167
cecfbb5f8618
child 169
08adb4f87160
equal deleted inserted replaced
167:cecfbb5f8618 168:6db9c5d7d7ff
81 alfree(map->allocator, map->map); 81 alfree(map->allocator, map->map);
82 alfree(map->allocator, map); 82 alfree(map->allocator, map);
83 } 83 }
84 84
85 void ucx_map_clear(UcxMap *map) { 85 void ucx_map_clear(UcxMap *map) {
86 if (map->count == 0) {
87 return; // nothing to do
88 }
86 ucx_map_free_elmlist_contents(map); 89 ucx_map_free_elmlist_contents(map);
87 memset(map->map, 0, map->size*sizeof(UcxMapElement*)); 90 memset(map->map, 0, map->size*sizeof(UcxMapElement*));
88 map->count = 0; 91 map->count = 0;
89 } 92 }
90 93

mercurial