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
+1 -1
View File
@@ -240,7 +240,7 @@ int main(int argc, const char *argv[]) {
LIST_JOIN(item, head, head2);
assert_se(head2 == NULL);
assert_se(!LIST_IS_EMPTY(head));
assert_se(head);
for (i = 0; i < ELEMENTSOF(items); i++)
LIST_REMOVE(item, head, &items[i]);