From: mquinson Date: Tue, 22 Aug 2006 23:09:04 +0000 (+0000) Subject: Don't bother emptying empty dicts in dict_reset X-Git-Tag: v3.3~2623 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/df9e08cec9819d1e4b98cdbcb4da710d1fdb4d51 Don't bother emptying empty dicts in dict_reset git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2736 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/xbt/dict.c b/src/xbt/dict.c index a51a2abe1f..07c594502d 100644 --- a/src/xbt/dict.c +++ b/src/xbt/dict.c @@ -368,6 +368,10 @@ void xbt_dict_reset(xbt_dict_t dict) { int i; xbt_dictelm_t current, previous = NULL; + + if (dict->count == 0) + return; + for (i = 0; i < dict->table_size; i++) { current = dict->table[i]; while (current != NULL) {