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:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user