allow remove of current entry
authorChristian Grothoff <christian@grothoff.org>
Mon, 22 Feb 2010 08:53:48 +0000 (08:53 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 22 Feb 2010 08:53:48 +0000 (08:53 +0000)
src/util/container_multihashmap.c

index 773b24928b06367f74e5996060cab9c3aa3ff85d..bf596751302292e68b72dc498dda0f0240798a40 100644 (file)
@@ -192,17 +192,18 @@ GNUNET_CONTAINER_multihashmap_iterate (const struct
   int count;
   unsigned int i;
   struct MapEntry *e;
+  struct MapEntry *n;
 
   count = 0;
   for (i = 0; i < map->map_length; i++)
     {
-      e = map->map[i];
-      while (e != NULL)
+      n = map->map[i];
+      while (NULL != (e = n))
         {
+         n = e->next;
           if ((NULL != it) && (GNUNET_OK != it (it_cls, &e->key, e->value)))
             return GNUNET_SYSERR;
           count++;
-          e = e->next;
         }
     }
   return count;