summaryrefslogtreecommitdiff
path: root/src/backend/nodes/list.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/nodes/list.c')
-rw-r--r--src/backend/nodes/list.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/backend/nodes/list.c b/src/backend/nodes/list.c
index 207acea947..7467e1a00e 100644
--- a/src/backend/nodes/list.c
+++ b/src/backend/nodes/list.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.49 2003/05/28 22:32:49 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.50 2003/06/15 22:51:45 tgl Exp $
*
* NOTES
* XXX a few of the following functions are duplicated to handle
@@ -359,6 +359,21 @@ llast(List *l)
}
/*
+ * llastnode
+ *
+ * Get the last node of l ... NIL if empty list
+ */
+List *
+llastnode(List *l)
+{
+ if (l == NIL)
+ return NIL;
+ while (lnext(l) != NIL)
+ l = lnext(l);
+ return l;
+}
+
+/*
* freeList
*
* Free the List nodes of a list