]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/dbus-execute.c
basic/list: drop LIST_IS_EMPTY
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 28 Jun 2022 16:37:34 +0000 (18:37 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 2 Jul 2022 10:46:16 +0000 (12:46 +0200)
commit64903d18dfd0344d5af3c0f8006b2e220de90091
treef6ed4047b5d324adb513115fc9315ce25aaec5af
parenta4d60b3e1c2097c3e23084aed401e3529b138df1
basic/list: drop LIST_IS_EMPTY

This was a trivial wrapper that didn't provide any added value. With more
complicated structures like strvs, hashmaps, sets, and arrays, it is possible
to have an empty container. But in case of a list, the list is empty only when
the head is missing.

Also, we generally want the positive condition, so we replace many
if (!LIST_IS_EMPTY(x)) with just if (x).
14 files changed:
coccinelle/macros.h
src/basic/list.h
src/core/cgroup.c
src/core/dbus-cgroup.c
src/core/dbus-execute.c
src/core/dbus-util.c
src/core/load-fragment.c
src/core/unit.c
src/libsystemd/sd-event/sd-event.c
src/resolve/resolved-conf.c
src/resolve/resolved-dnssd.c
src/test/test-list.c
src/udev/udev-rules.c
src/udev/udevd.c