aboutsummaryrefslogtreecommitdiff
path: root/src/util/container_multihashmap.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-01-29 12:21:03 +0000
committerChristian Grothoff <christian@grothoff.org>2010-01-29 12:21:03 +0000
commit1d331d111abd6285148321262a50ca7784eaaf97 (patch)
tree61cdee0f656e74c83ed847e6450150f497e11c66 /src/util/container_multihashmap.c
parent8c00b9a438e404d85bd5324927e23eaf209ade51 (diff)
downloadgnunet-1d331d111abd6285148321262a50ca7784eaaf97.tar.gz
gnunet-1d331d111abd6285148321262a50ca7784eaaf97.zip
support removing of current entry by callback
Diffstat (limited to 'src/util/container_multihashmap.c')
-rw-r--r--src/util/container_multihashmap.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/util/container_multihashmap.c b/src/util/container_multihashmap.c
index e291b8b50..773b24928 100644
--- a/src/util/container_multihashmap.c
+++ b/src/util/container_multihashmap.c
@@ -435,18 +435,18 @@ GNUNET_CONTAINER_multihashmap_get_multiple (const struct
435{ 435{
436 int count; 436 int count;
437 struct MapEntry *e; 437 struct MapEntry *e;
438 struct MapEntry *n;
438 439
439 count = 0; 440 count = 0;
440 e = map->map[idx_of (map, key)]; 441 n = map->map[idx_of (map, key)];
441 while (e != NULL) 442 while (NULL != (e = n))
442 { 443 {
443 if (0 == memcmp (key, &e->key, sizeof (GNUNET_HashCode))) 444 n = e->next;
444 { 445 if (0 != memcmp (key, &e->key, sizeof (GNUNET_HashCode)))
445 if ((it != NULL) && (GNUNET_OK != it (it_cls, &e->key, e->value))) 446 continue;
446 return GNUNET_SYSERR; 447 if ((it != NULL) && (GNUNET_OK != it (it_cls, &e->key, e->value)))
447 count++; 448 return GNUNET_SYSERR;
448 } 449 count++;
449 e = e->next;
450 } 450 }
451 return count; 451 return count;
452} 452}