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).
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2022-07-02 12:46:16 +02:00
parent a4d60b3e1c
commit 64903d18df
14 changed files with 23 additions and 29 deletions
-3
View File
@@ -170,9 +170,6 @@
i != (p); \
i = i->name##_next ? i->name##_next : (head))
#define LIST_IS_EMPTY(head) \
(!(head))
/* Join two lists tail to head: a->b, c->d to a->b->c->d and de-initialise second list */
#define LIST_JOIN(name,a,b) \
do { \