diff options
| author | Dima Zavin <dima@android.com> | 2011-04-27 17:06:53 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-04-27 17:06:53 -0700 |
| commit | c5ae7dbf4c189b986a7937fd212ea29d0b9bd1a4 (patch) | |
| tree | d74856689116772cb38ad88c3b27f75437f4b02e | |
| parent | 4682abaaa6f714d7bcfcf861af77b1b3c3c64281 (diff) | |
| parent | 4fab9ac04e444f8ad057e67006320ca25381948e (diff) | |
| download | system_core-c5ae7dbf4c189b986a7937fd212ea29d0b9bd1a4.tar.gz system_core-c5ae7dbf4c189b986a7937fd212ea29d0b9bd1a4.tar.bz2 system_core-c5ae7dbf4c189b986a7937fd212ea29d0b9bd1a4.zip | |
Merge "libcutils: hashmap: save next pointer in forEach before calling callback"
| -rw-r--r-- | libcutils/hashmap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libcutils/hashmap.c b/libcutils/hashmap.c index e29bc246..65539ea3 100644 --- a/libcutils/hashmap.c +++ b/libcutils/hashmap.c @@ -310,10 +310,11 @@ void hashmapForEach(Hashmap* map, for (i = 0; i < map->bucketCount; i++) { Entry* entry = map->buckets[i]; while (entry != NULL) { + Entry *next = entry->next; if (!callback(entry->key, entry->value, context)) { return; } - entry = entry->next; + entry = next; } } } |
