diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-01-28 00:37:11 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-01-28 00:37:11 +0100 |
commit | caac2704d57ef6d95f7053456479353bae3638de (patch) | |
tree | 043041df0ecd6e3e7ad3245419b76958b5de9b1a /src/core | |
parent | 7663df377016cf7b95001aec893006647175ae4a (diff) |
swap: simplify a few things by making use of new LIST_FOREACH_OTHERS macro
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/swap.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/core/swap.c b/src/core/swap.c index cc03b14e76..b97f102d64 100644 --- a/src/core/swap.c +++ b/src/core/swap.c @@ -1178,11 +1178,7 @@ static Unit *swap_following(Unit *u) { if (s->from_fragment) return NULL; - LIST_FOREACH_AFTER(same_devnode, other, s) - if (other->from_fragment) - return UNIT(other); - - LIST_FOREACH_BEFORE(same_devnode, other, s) + LIST_FOREACH_OTHERS(same_devnode, other, s) if (other->from_fragment) return UNIT(other); @@ -1224,13 +1220,7 @@ static int swap_following_set(Unit *u, Set **_set) { if (!set) return -ENOMEM; - LIST_FOREACH_AFTER(same_devnode, other, s) { - r = set_put(set, other); - if (r < 0) - goto fail; - } - - LIST_FOREACH_BEFORE(same_devnode, other, s) { + LIST_FOREACH_OTHERS(same_devnode, other, s) { r = set_put(set, other); if (r < 0) goto fail; |