1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-11 10:01:57 +03:00

Code cleanup inspired by recent resname bug report (doesn't fix the bug

yet, though).  Avoid using nth() to fetch tlist entries; provide a
common routine get_tle_by_resno() to search a tlist for a particular
resno.  This replaces a couple uses of nth() and a dozen hand-coded
search loops.  Also, replace a few uses of nth(length-1, list) with
llast().
This commit is contained in:
Tom Lane
2003-08-11 20:46:47 +00:00
parent cae912d05b
commit 88381ade63
12 changed files with 161 additions and 316 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/not_in.c,v 1.35 2003/08/04 02:40:05 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/not_in.c,v 1.36 2003/08/11 20:46:46 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -63,7 +63,7 @@ int4notin(PG_FUNCTION_ARGS)
(errcode(ERRCODE_INVALID_NAME),
errmsg("invalid name syntax"),
errhint("Must provide \"relationname.attributename\".")));
attribute = strVal(nth(nnames - 1, names));
attribute = strVal(llast(names));
names = ltruncate(nnames - 1, names);
relrv = makeRangeVarFromNameList(names);