mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	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()
This commit is contained in:
		@@ -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 -
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user