ucx/map.c

changeset 168
6db9c5d7d7ff
parent 167
cecfbb5f8618
child 169
08adb4f87160
--- a/ucx/map.c	Thu Oct 15 12:37:01 2015 +0200
+++ b/ucx/map.c	Thu Oct 15 12:46:09 2015 +0200
@@ -83,6 +83,9 @@
 }
 
 void ucx_map_clear(UcxMap *map) {
+    if (map->count == 0) {
+        return; // nothing to do
+    }
     ucx_map_free_elmlist_contents(map);
     memset(map->map, 0, map->size*sizeof(UcxMapElement*));
     map->count = 0;

mercurial