From df9e08cec9819d1e4b98cdbcb4da710d1fdb4d51 Mon Sep 17 00:00:00 2001 From: mquinson Date: Tue, 22 Aug 2006 23:09:04 +0000 Subject: [PATCH] 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 --- src/xbt/dict.c | 4 ++++ 1 file changed, 4 insertions(+) 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) { -- 2.20.1