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 |