Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't bother emptying empty dicts in dict_reset
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 22 Aug 2006 23:09:04 +0000 (23:09 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 22 Aug 2006 23:09:04 +0000 (23:09 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2736 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/xbt/dict.c

index a51a2ab..07c5945 100644 (file)
@@ -368,6 +368,10 @@ void xbt_dict_reset(xbt_dict_t dict) {
 
   int i;
   xbt_dictelm_t current, previous = NULL;
 
   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) {
   for (i = 0; i < dict->table_size; i++) {
     current = dict->table[i];
     while (current != NULL) {