From 88381ade63de931c84f53dc873c986d40b8c8b61 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 11 Aug 2003 20:46:47 +0000 Subject: 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(). --- src/backend/utils/adt/not_in.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/backend/utils/adt/not_in.c') diff --git a/src/backend/utils/adt/not_in.c b/src/backend/utils/adt/not_in.c index a92c13841f..42ce2d2fcb 100644 --- a/src/backend/utils/adt/not_in.c +++ b/src/backend/utils/adt/not_in.c @@ -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); -- cgit v1.2.1