# HG changeset patch # User Mike Becker # Date 1444905590 -7200 # Node ID 1de85ecf6adc7e6b35419009b918f44b66226305 # Parent 58b77eb51afd13beb01d603cb47f714c09cfabc6 optimized ucx_map_clear (noop for count == 0) diff -r 58b77eb51afd -r 1de85ecf6adc ucx/map.c --- a/ucx/map.c Thu Oct 15 12:34:10 2015 +0200 +++ b/ucx/map.c Thu Oct 15 12:39:50 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;