From 64a60590ba5da8026abb65a7abe8fce9e573c476 Mon Sep 17 00:00:00 2001 From: Neil Conway Date: Mon, 27 Sep 2004 04:12:03 +0000 Subject: A few minor list-related cleanups: (1) Replace while loop with the new forboth() construct in parser/analyze.c (2) Replace lcons() with lappend() in SearchCatCacheList(). Since these now have the same performance, there is no reason to prefer lcons() in this case, and using lappend() leads to cleaner code. (3) Improve the name of the second parameter to for_each_cell() --- src/include/nodes/pg_list.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/include') diff --git a/src/include/nodes/pg_list.h b/src/include/nodes/pg_list.h index c35e7c64ba1..d8957b35223 100644 --- a/src/include/nodes/pg_list.h +++ b/src/include/nodes/pg_list.h @@ -30,7 +30,7 @@ * Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/nodes/pg_list.h,v 1.49 2004/08/29 05:06:57 momjian Exp $ + * $PostgreSQL: pgsql/src/include/nodes/pg_list.h,v 1.50 2004/09/27 04:12:03 neilc Exp $ * *------------------------------------------------------------------------- */ @@ -167,8 +167,8 @@ extern int list_length(List *l); * a convenience macro which loops through a list starting from a * specified cell */ -#define for_each_cell(cell, l) \ - for ((cell) = (l); (cell) != NULL; (cell) = lnext(cell)) +#define for_each_cell(cell, initcell) \ + for ((cell) = (initcell); (cell) != NULL; (cell) = lnext(cell)) /* * forboth - -- cgit v1.2.3