v1-0001-list_is_empty-new-function.patch
application/octet-stream
Filename: v1-0001-list_is_empty-new-function.patch
Type: application/octet-stream
Part: 1
Patch
Format: format-patch
Series: patch v1-0001
Subject: list_is_empty - new function
| File | + | − |
|---|---|---|
| src/include/nodes/pg_list.h | 7 | 0 |
From 1d055ff6673e104a1760d028b54b7466a87b2e48 Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
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