diff options
author | Harald Hoyer <harald@redhat.com> | 2010-09-24 12:06:01 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-09-27 02:09:47 +0200 |
commit | 66d9b3b59551a33398b2201662af5c8c17a367c9 (patch) | |
tree | 79f852b201a9653ba8fce8074526104b1a319dee /src/hashmap.h | |
parent | 0ebd74d8d9ffc4ea47cc8fe8798466bdf4e6967f (diff) |
hashmap: HASHMAP_FOREACH* iterate until ITERATOR_LAST
Diffstat (limited to 'src/hashmap.h')
-rw-r--r-- | src/hashmap.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/hashmap.h b/src/hashmap.h index ac5a8ae085..9f89d7c865 100644 --- a/src/hashmap.h +++ b/src/hashmap.h @@ -77,12 +77,12 @@ void* hashmap_first(Hashmap *h); void* hashmap_last(Hashmap *h); #define HASHMAP_FOREACH(e, h, i) \ - for ((i) = ITERATOR_FIRST, (e) = hashmap_iterate((h), &(i), NULL); (e); (e) = hashmap_iterate((h), &(i), NULL)) + for ((i) = ITERATOR_FIRST, (e) = hashmap_iterate((h), &(i), NULL); (i) != ITERATOR_LAST; (e) = hashmap_iterate((h), &(i), NULL)) #define HASHMAP_FOREACH_KEY(e, k, h, i) \ - for ((i) = ITERATOR_FIRST, (e) = hashmap_iterate((h), &(i), (const void**) &(k)); (e); (e) = hashmap_iterate((h), &(i), (const void**) &(k))) + for ((i) = ITERATOR_FIRST, (e) = hashmap_iterate((h), &(i), (const void**) &(k)); (i) != ITERATOR_LAST; (e) = hashmap_iterate((h), &(i), (const void**) &(k))) #define HASHMAP_FOREACH_BACKWARDS(e, h, i) \ - for ((i) = ITERATOR_LAST, (e) = hashmap_iterate_backwards((h), &(i), NULL); (e); (e) = hashmap_iterate_backwards((h), &(i), NULL)) + for ((i) = ITERATOR_LAST, (e) = hashmap_iterate_backwards((h), &(i), NULL); (i) != ITERATOR_FIRST; (e) = hashmap_iterate_backwards((h), &(i), NULL)) #endif |