summaryrefslogtreecommitdiff
path: root/src/basic/set.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-02-29 23:18:16 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-02-29 23:18:16 -0500
commit6014237390d5d9a20a274d4fcd9c84669cacca83 (patch)
tree5c676e1d5850f389968c222cc02715bf8303d96a /src/basic/set.h
parent97a437d24cc97bc7132d3d3696b4c41e5a93edca (diff)
parent35aa04e9edf422beac3493afa555d29575b3046c (diff)
Merge pull request #2702 from poettering/resolved-iterate-fix
resolved iteration fix
Diffstat (limited to 'src/basic/set.h')
-rw-r--r--src/basic/set.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/basic/set.h b/src/basic/set.h
index 2bff5062da..e0d9dd001c 100644
--- a/src/basic/set.h
+++ b/src/basic/set.h
@@ -126,6 +126,9 @@ int set_put_strdupv(Set *s, char **l);
#define SET_FOREACH(e, s, i) \
for ((i) = ITERATOR_FIRST; set_iterate((s), &(i), (void**)&(e)); )
+#define SET_FOREACH_MOVE(e, d, s) \
+ for (; ({ e = set_first(s); assert_se(!e || set_move_one(d, s, e) >= 0); e; }); )
+
DEFINE_TRIVIAL_CLEANUP_FUNC(Set*, set_free);
DEFINE_TRIVIAL_CLEANUP_FUNC(Set*, set_free_free);