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

Commita0d6e29

Browse files
committed
Some more de-FastList-ification.
1 parent80c6847 commita0d6e29

File tree

3 files changed

+38
-50
lines changed

3 files changed

+38
-50
lines changed

‎src/backend/executor/execQual.c

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.161 2004/05/30 23:40:26 neilc Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.162 2004/06/01 03:28:41 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -2826,12 +2826,11 @@ ExecInitExpr(Expr *node, PlanState *parent)
28262826
{
28272827
CaseExpr*caseexpr= (CaseExpr*)node;
28282828
CaseExprState*cstate=makeNode(CaseExprState);
2829-
FastListoutlist;
2829+
List*outlist=NIL;
28302830
ListCell*l;
28312831

28322832
cstate->xprstate.evalfunc= (ExprStateEvalFunc)ExecEvalCase;
28332833
cstate->arg=ExecInitExpr(caseexpr->arg,parent);
2834-
FastListInit(&outlist);
28352834
foreach(l,caseexpr->args)
28362835
{
28372836
CaseWhen*when= (CaseWhen*)lfirst(l);
@@ -2842,9 +2841,9 @@ ExecInitExpr(Expr *node, PlanState *parent)
28422841
wstate->xprstate.expr= (Expr*)when;
28432842
wstate->expr=ExecInitExpr(when->expr,parent);
28442843
wstate->result=ExecInitExpr(when->result,parent);
2845-
FastAppend(&outlist,wstate);
2844+
outlist=lappend(outlist,wstate);
28462845
}
2847-
cstate->args=FastListValue(&outlist);
2846+
cstate->args=outlist;
28482847
cstate->defresult=ExecInitExpr(caseexpr->defresult,parent);
28492848
state= (ExprState*)cstate;
28502849
}
@@ -2853,20 +2852,19 @@ ExecInitExpr(Expr *node, PlanState *parent)
28532852
{
28542853
ArrayExpr*arrayexpr= (ArrayExpr*)node;
28552854
ArrayExprState*astate=makeNode(ArrayExprState);
2856-
FastListoutlist;
2855+
List*outlist=NIL;
28572856
ListCell*l;
28582857

28592858
astate->xprstate.evalfunc= (ExprStateEvalFunc)ExecEvalArray;
2860-
FastListInit(&outlist);
28612859
foreach(l,arrayexpr->elements)
28622860
{
28632861
Expr*e= (Expr*)lfirst(l);
28642862
ExprState*estate;
28652863

28662864
estate=ExecInitExpr(e,parent);
2867-
FastAppend(&outlist,estate);
2865+
outlist=lappend(outlist,estate);
28682866
}
2869-
astate->elements=FastListValue(&outlist);
2867+
astate->elements=outlist;
28702868
/* do one-time catalog lookup for type info */
28712869
get_typlenbyvalalign(arrayexpr->element_typeid,
28722870
&astate->elemlength,
@@ -2879,11 +2877,10 @@ ExecInitExpr(Expr *node, PlanState *parent)
28792877
{
28802878
RowExpr*rowexpr= (RowExpr*)node;
28812879
RowExprState*rstate=makeNode(RowExprState);
2882-
List*outlist;
2880+
List*outlist=NIL;
28832881
ListCell*l;
28842882

28852883
rstate->xprstate.evalfunc= (ExprStateEvalFunc)ExecEvalRow;
2886-
outlist=NIL;
28872884
foreach(l,rowexpr->args)
28882885
{
28892886
Expr*e= (Expr*)lfirst(l);
@@ -2912,20 +2909,19 @@ ExecInitExpr(Expr *node, PlanState *parent)
29122909
{
29132910
CoalesceExpr*coalesceexpr= (CoalesceExpr*)node;
29142911
CoalesceExprState*cstate=makeNode(CoalesceExprState);
2915-
FastListoutlist;
2912+
List*outlist=NIL;
29162913
ListCell*l;
29172914

29182915
cstate->xprstate.evalfunc= (ExprStateEvalFunc)ExecEvalCoalesce;
2919-
FastListInit(&outlist);
29202916
foreach(l,coalesceexpr->args)
29212917
{
29222918
Expr*e= (Expr*)lfirst(l);
29232919
ExprState*estate;
29242920

29252921
estate=ExecInitExpr(e,parent);
2926-
FastAppend(&outlist,estate);
2922+
outlist=lappend(outlist,estate);
29272923
}
2928-
cstate->args=FastListValue(&outlist);
2924+
cstate->args=outlist;
29292925
state= (ExprState*)cstate;
29302926
}
29312927
break;
@@ -2984,18 +2980,17 @@ ExecInitExpr(Expr *node, PlanState *parent)
29842980
break;
29852981
caseT_List:
29862982
{
2987-
FastListoutlist;
2983+
List*outlist=NIL;
29882984
ListCell*l;
29892985

2990-
FastListInit(&outlist);
29912986
foreach(l, (List*)node)
29922987
{
2993-
FastAppend(&outlist,
2994-
ExecInitExpr((Expr*)lfirst(l),
2995-
parent));
2988+
outlist=lappend(outlist,
2989+
ExecInitExpr((Expr*)lfirst(l),
2990+
parent));
29962991
}
29972992
/* Don't fall through to the "common" code below */
2998-
return (ExprState*)FastListValue(&outlist);
2993+
return (ExprState*)outlist;
29992994
}
30002995
default:
30012996
elog(ERROR,"unrecognized node type: %d",

‎src/backend/parser/gram.y

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.458 2004/05/30 23:40:34 neilc Exp $
14+
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.459 2004/06/01 03:28:48 tgl Exp $
1515
*
1616
* HISTORY
1717
* AUTHORDATEMAJOR EVENT
@@ -108,7 +108,6 @@ static void doNegateFloat(Value *v);
108108
OnCommitActiononcommit;
109109
ContainsOidswithoids;
110110
List*list;
111-
FastListfastlist;
112111
Node*node;
113112
Value*value;
114113
ColumnRef*columnref;
@@ -6820,15 +6819,11 @@ opt_indirection:
68206819

68216820
expr_list:a_expr
68226821
{
6823-
FastList *dst = (FastList *) &$$;
6824-
makeFastList1(dst, $1);
6822+
$$ =list_make1($1);
68256823
}
68266824
| expr_list',' a_expr
68276825
{
6828-
FastList *dst = (FastList *) &$$;
6829-
FastList *src = (FastList *) &$1;
6830-
*dst = *src;
6831-
FastAppend(dst, $3);
6826+
$$ =lappend($1, $3);
68326827
}
68336828
;
68346829

‎src/backend/parser/parse_target.c

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/parser/parse_target.c,v 1.119 2004/05/30 23:40:35 neilc Exp $
11+
* $PostgreSQL: pgsql/src/backend/parser/parse_target.c,v 1.120 2004/06/01 03:28:48 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -92,11 +92,9 @@ transformTargetEntry(ParseState *pstate,
9292
List*
9393
transformTargetList(ParseState*pstate,List*targetlist)
9494
{
95-
FastListp_target;
95+
List*p_target=NIL;
9696
ListCell*o_target;
9797

98-
FastListInit(&p_target);
99-
10098
foreach(o_target,targetlist)
10199
{
102100
ResTarget*res= (ResTarget*)lfirst(o_target);
@@ -116,8 +114,8 @@ transformTargetList(ParseState *pstate, List *targetlist)
116114
* Target item is a single '*', expand all tables
117115
* (e.g., SELECT * FROM emp)
118116
*/
119-
FastConc(&p_target,
120-
ExpandAllTables(pstate));
117+
p_target=list_concat(p_target,
118+
ExpandAllTables(pstate));
121119
}
122120
else
123121
{
@@ -173,34 +171,34 @@ transformTargetList(ParseState *pstate, List *targetlist)
173171
rte=addImplicitRTE(pstate,makeRangeVar(schemaname,
174172
relname));
175173

176-
FastConc(&p_target,
177-
expandRelAttrs(pstate,rte));
174+
p_target=list_concat(p_target,
175+
expandRelAttrs(pstate,rte));
178176
}
179177
}
180178
else
181179
{
182180
/* Plain ColumnRef node, treat it as an expression */
183-
FastAppend(&p_target,
184-
transformTargetEntry(pstate,
185-
res->val,
186-
NULL,
187-
res->name,
188-
false));
181+
p_target=lappend(p_target,
182+
transformTargetEntry(pstate,
183+
res->val,
184+
NULL,
185+
res->name,
186+
false));
189187
}
190188
}
191189
else
192190
{
193191
/* Everything else but ColumnRef */
194-
FastAppend(&p_target,
195-
transformTargetEntry(pstate,
196-
res->val,
197-
NULL,
198-
res->name,
199-
false));
192+
p_target=lappend(p_target,
193+
transformTargetEntry(pstate,
194+
res->val,
195+
NULL,
196+
res->name,
197+
false));
200198
}
201199
}
202200

203-
returnFastListValue(&p_target);
201+
returnp_target;
204202
}
205203

206204

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp