Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0858ed2

Browse files
committed
A couple other cosmetic cleanups in new List stuff.
1 parent437063b commit0858ed2

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

‎src/backend/utils/adt/ruleutils.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*back to source text
44
*
55
* IDENTIFICATION
6-
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.167 2004/05/2604:41:38 neilc Exp $
6+
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.168 2004/05/2619:30:12 tgl Exp $
77
*
88
* This software is copyrighted by Jan Wieck - Hamburg.
99
*
@@ -2274,17 +2274,14 @@ static void
22742274
get_names_for_var(Var*var,deparse_context*context,
22752275
char**schemaname,char**refname,char**attname)
22762276
{
2277-
ListCell*nslist_item=list_head(context->namespaces);
2278-
intsup=var->varlevelsup;
22792277
deparse_namespace*dpns;
22802278
RangeTblEntry*rte;
22812279

22822280
/* Find appropriate nesting depth */
2283-
while (sup-->0&&nslist_item!=NULL)
2284-
nslist_item=lnext(nslist_item);
2285-
if (nslist_item==NULL)
2281+
if (var->varlevelsup >=list_length(context->namespaces))
22862282
elog(ERROR,"bogus varlevelsup: %d",var->varlevelsup);
2287-
dpns= (deparse_namespace*)lfirst(nslist_item);
2283+
dpns= (deparse_namespace*)list_nth(context->namespaces,
2284+
var->varlevelsup);
22882285

22892286
/* Find the relevant RTE */
22902287
if (var->varno >=1&&var->varno <=length(dpns->rtable))

‎src/include/nodes/pg_list.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/nodes/pg_list.h,v 1.44 2004/05/2604:41:45 neilc Exp $
10+
* $PostgreSQL: pgsql/src/include/nodes/pg_list.h,v 1.45 2004/05/2619:30:17 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -49,8 +49,6 @@
4949
* always be so; try to be careful to maintain the distinction.)
5050
*/
5151

52-
#defineLIST_CELL_TYPE ListCell
53-
5452
typedefstructListCellListCell;
5553
typedefstructListList;
5654

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp