[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r10168 - gnunet/src/util
From: |
gnunet |
Subject: |
[GNUnet-SVN] r10168 - gnunet/src/util |
Date: |
Fri, 29 Jan 2010 13:21:03 +0100 |
Author: grothoff
Date: 2010-01-29 13:21:03 +0100 (Fri, 29 Jan 2010)
New Revision: 10168
Modified:
gnunet/src/util/container_multihashmap.c
Log:
support removing of current entry by callback
Modified: gnunet/src/util/container_multihashmap.c
===================================================================
--- gnunet/src/util/container_multihashmap.c 2010-01-29 12:20:57 UTC (rev
10167)
+++ gnunet/src/util/container_multihashmap.c 2010-01-29 12:21:03 UTC (rev
10168)
@@ -435,18 +435,18 @@
{
int count;
struct MapEntry *e;
+ struct MapEntry *n;
count = 0;
- e = map->map[idx_of (map, key)];
- while (e != NULL)
+ n = map->map[idx_of (map, key)];
+ while (NULL != (e = n))
{
- if (0 == memcmp (key, &e->key, sizeof (GNUNET_HashCode)))
- {
- if ((it != NULL) && (GNUNET_OK != it (it_cls, &e->key, e->value)))
- return GNUNET_SYSERR;
- count++;
- }
- e = e->next;
+ n = e->next;
+ if (0 != memcmp (key, &e->key, sizeof (GNUNET_HashCode)))
+ continue;
+ if ((it != NULL) && (GNUNET_OK != it (it_cls, &e->key, e->value)))
+ return GNUNET_SYSERR;
+ count++;
}
return count;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r10168 - gnunet/src/util,
gnunet <=