diff options
Diffstat (limited to 'src/backend/nodes/list.c')
-rw-r--r-- | src/backend/nodes/list.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/backend/nodes/list.c b/src/backend/nodes/list.c index 358e6a7eb6f..66674b5c364 100644 --- a/src/backend/nodes/list.c +++ b/src/backend/nodes/list.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.34 2000/09/29 18:21:29 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.35 2000/10/05 19:11:27 tgl Exp $ * * NOTES * XXX a few of the following functions are duplicated to handle @@ -237,10 +237,32 @@ freeList(List *list) } /* + * equali + * compares two lists of integers + */ +bool +equali(List *list1, List *list2) +{ + List *l; + + foreach(l, list1) + { + if (list2 == NIL) + return false; + if (lfirsti(l) != lfirsti(list2)) + return false; + list2 = lnext(list2); + } + if (list2 != NIL) + return false; + return true; +} + +/* * sameseti * * Returns t if two integer lists contain the same elements - * (but unlike equal(), they need not be in the same order) + * (but unlike equali(), they need not be in the same order) * * Caution: this routine could be fooled if list1 contains * duplicate elements. It is intended to be used on lists |