ucx/map.c

changeset 207
1de85ecf6adc
parent 206
58b77eb51afd
child 208
262c7be94eba
equal deleted inserted replaced
206:58b77eb51afd 207:1de85ecf6adc
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