1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-09 06:21:09 +03:00

Some more de-FastList-ification.

This commit is contained in:
Tom Lane
2004-06-01 03:28:48 +00:00
parent 80c6847cc5
commit a0d6e29ee7
3 changed files with 38 additions and 50 deletions

View File

@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.458 2004/05/30 23:40:34 neilc Exp $
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.459 2004/06/01 03:28:48 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -108,7 +108,6 @@ static void doNegateFloat(Value *v);
OnCommitAction oncommit;
ContainsOids withoids;
List *list;
FastList fastlist;
Node *node;
Value *value;
ColumnRef *columnref;
@@ -6820,15 +6819,11 @@ opt_indirection:
expr_list: a_expr
{
FastList *dst = (FastList *) &$$;
makeFastList1(dst, $1);
$$ = list_make1($1);
}
| expr_list ',' a_expr
{
FastList *dst = (FastList *) &$$;
FastList *src = (FastList *) &$1;
*dst = *src;
FastAppend(dst, $3);
$$ = lappend($1, $3);
}
;

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/parse_target.c,v 1.119 2004/05/30 23:40:35 neilc Exp $
* $PostgreSQL: pgsql/src/backend/parser/parse_target.c,v 1.120 2004/06/01 03:28:48 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -92,11 +92,9 @@ transformTargetEntry(ParseState *pstate,
List *
transformTargetList(ParseState *pstate, List *targetlist)
{
FastList p_target;
List *p_target = NIL;
ListCell *o_target;
FastListInit(&p_target);
foreach(o_target, targetlist)
{
ResTarget *res = (ResTarget *) lfirst(o_target);
@@ -116,8 +114,8 @@ transformTargetList(ParseState *pstate, List *targetlist)
* Target item is a single '*', expand all tables
* (e.g., SELECT * FROM emp)
*/
FastConc(&p_target,
ExpandAllTables(pstate));
p_target = list_concat(p_target,
ExpandAllTables(pstate));
}
else
{
@@ -173,34 +171,34 @@ transformTargetList(ParseState *pstate, List *targetlist)
rte = addImplicitRTE(pstate, makeRangeVar(schemaname,
relname));
FastConc(&p_target,
expandRelAttrs(pstate, rte));
p_target = list_concat(p_target,
expandRelAttrs(pstate, rte));
}
}
else
{
/* Plain ColumnRef node, treat it as an expression */
FastAppend(&p_target,
transformTargetEntry(pstate,
res->val,
NULL,
res->name,
false));
p_target = lappend(p_target,
transformTargetEntry(pstate,
res->val,
NULL,
res->name,
false));
}
}
else
{
/* Everything else but ColumnRef */
FastAppend(&p_target,
transformTargetEntry(pstate,
res->val,
NULL,
res->name,
false));
p_target = lappend(p_target,
transformTargetEntry(pstate,
res->val,
NULL,
res->name,
false));
}
}
return FastListValue(&p_target);
return p_target;
}