summaryrefslogtreecommitdiff
path: root/src/basic/ordered-set.h
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2015-06-16 14:44:43 +0200
committerMichal Schmidt <mschmidt@redhat.com>2015-06-16 14:44:43 +0200
commit9ef41ffeec0a677f0c8006b17e5ff1c8434418a3 (patch)
treeb0f66b97ddf0e13c4cd1240fc0fd7ef6ad618a82 /src/basic/ordered-set.h
parentaab723074c368f65aaf2748d0c530ba9a1e6ad3e (diff)
parent8927b1dad2d4a7330174cb924090b4635a2547fb (diff)
Merge pull request #197 from dvdhrm/hashmap
hashmap: fix iterators to not skip entries
Diffstat (limited to 'src/basic/ordered-set.h')
-rw-r--r--src/basic/ordered-set.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/basic/ordered-set.h b/src/basic/ordered-set.h
index 766a1f2e83..6c617ab305 100644
--- a/src/basic/ordered-set.h
+++ b/src/basic/ordered-set.h
@@ -47,12 +47,12 @@ static inline bool ordered_set_isempty(OrderedSet *s) {
return ordered_hashmap_isempty((OrderedHashmap*) s);
}
-static inline void *ordered_set_iterate(OrderedSet *s, Iterator *i) {
- return ordered_hashmap_iterate((OrderedHashmap*) s, i, NULL);
+static inline bool ordered_set_iterate(OrderedSet *s, Iterator *i, void **value) {
+ return ordered_hashmap_iterate((OrderedHashmap*) s, i, value, NULL);
}
#define ORDERED_SET_FOREACH(e, s, i) \
- for ((i) = ITERATOR_FIRST, (e) = ordered_set_iterate((s), &(i)); (e); (e) = ordered_set_iterate((s), &(i)))
+ for ((i) = ITERATOR_FIRST; ordered_set_iterate((s), &(i), (void**)&(e)); )
DEFINE_TRIVIAL_CLEANUP_FUNC(OrderedSet*, ordered_set_free);