From 64903d18dfd0344d5af3c0f8006b2e220de90091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 28 Jun 2022 18:37:34 +0200 Subject: 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). --- coccinelle/macros.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'coccinelle') diff --git a/coccinelle/macros.h b/coccinelle/macros.h index 6a0a64bb05..f44b3f2d26 100644 --- a/coccinelle/macros.h +++ b/coccinelle/macros.h @@ -189,8 +189,6 @@ (i) != (p); \ (i) = (i)->name##_next ? (i)->name##_next : (head)) -#define LIST_IS_EMPTY(head) \ - (!(head)) #define LIST_JOIN(name,a,b) \ do { \ assert(b); \ -- cgit v1.2.1