From 1d055ff6673e104a1760d028b54b7466a87b2e48 Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Mon, 15 Aug 2022 17:47:05 +1000 Subject: [PATCH v1] list_is_empty - new function --- src/include/nodes/pg_list.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/include/nodes/pg_list.h b/src/include/nodes/pg_list.h index a6e04d0..88c37fb 100644 --- a/src/include/nodes/pg_list.h +++ b/src/include/nodes/pg_list.h @@ -152,6 +152,13 @@ list_length(const List *l) return l ? l->length : 0; } +/* Is the list empty? */ +static inline bool +list_is_empty(const List *l) +{ + return l == NIL; +} + /* * Macros to access the data values within List cells. * -- 1.8.3.1