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

Commit5088f07

Browse files
committed
Change lcons(x, NIL) to makeList(x) where appropriate.
1 parent8e98403 commit5088f07

File tree

12 files changed

+36
-35
lines changed

12 files changed

+36
-35
lines changed

‎src/backend/bootstrap/bootparse.y

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootparse.y,v 1.33 2000/11/21 21:15:59 petere Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootparse.y,v 1.34 2001/01/17 17:26:44 momjian Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -254,7 +254,7 @@ Boot_BuildIndsStmt:
254254

255255
boot_index_params:
256256
boot_index_params COMMA boot_index_param{$$ = lappend($1,$3); }
257-
| boot_index_param{$$ =lcons($1, NIL); }
257+
| boot_index_param{$$ =makeList1($1); }
258258
;
259259

260260
boot_index_param:

‎src/backend/commands/user.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.70 2000/11/16 22:30:19 tgl Exp $
9+
* $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.71 2001/01/17 17:26:44 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -311,7 +311,8 @@ CreateUser(CreateUserStmt *stmt)
311311
ags.name=strVal(lfirst(item));/* the group name to add
312312
* this in */
313313
ags.action=+1;
314-
ags.listUsers=lcons((void*)makeInteger(havesysid ?stmt->sysid :max_id+1),NIL);
314+
ags.listUsers=makeList1(makeInteger(havesysid ?
315+
stmt->sysid :max_id+1));
315316
AlterGroup(&ags,"CREATE USER");
316317
}
317318

@@ -600,7 +601,7 @@ DropUser(DropUserStmt *stmt)
600601
datum=heap_getattr(tmp_tuple,Anum_pg_group_groname,pg_dsc,&null);
601602
ags.name=DatumGetCString(DirectFunctionCall1(nameout,datum));
602603
ags.action=-1;
603-
ags.listUsers=lcons((void*)makeInteger(usesysid),NIL);
604+
ags.listUsers=makeList1(makeInteger(usesysid));
604605
AlterGroup(&ags,"DROP USER");
605606
}
606607
heap_endscan(scan);

‎src/backend/executor/execJunk.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.22 2000/01/26 05:56:21 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.23 2001/01/17 17:26:44 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -124,7 +124,7 @@ ExecInitJunkFilter(List *targetList, TupleDesc tupType)
124124
Fjoin*fjNode= (Fjoin*)tl_node(fjList);
125125

126126
cleanFjoin= (Fjoin)copyObject((Node)fjNode);
127-
cleanFjList=lcons(cleanFjoin,NIL);
127+
cleanFjList=makeList1(cleanFjoin);
128128

129129
resdom= (Resdom)lfirst(get_fj_innerNode(fjNode));
130130
expr=lsecond(get_fj_innerNode(fjNode));

‎src/backend/nodes/copyfuncs.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* Portions Copyright (c) 1994, Regents of the University of California
1616
*
1717
* IDENTIFICATION
18-
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.136 2001/01/05 06:34:17 tgl Exp $
18+
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.137 2001/01/17 17:26:44 momjian Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -58,11 +58,11 @@ listCopy(List *list)
5858
if (list==NIL)
5959
returnNIL;
6060

61-
newlist=nl=lcons(lfirst(list),NIL);
61+
newlist=nl=makeList1(lfirst(list));
6262

6363
foreach(l,lnext(list))
6464
{
65-
lnext(nl)=lcons(lfirst(l),NIL);
65+
lnext(nl)=makeList1(lfirst(l));
6666
nl=lnext(nl);
6767
}
6868
returnnewlist;
@@ -2745,12 +2745,12 @@ copyObject(void *from)
27452745

27462746
/* rather ugly coding for speed... */
27472747
/* Note the input list cannot be NIL if we got here. */
2748-
nl=lcons(copyObject(lfirst(list)),NIL);
2748+
nl=makeList1(copyObject(lfirst(list)));
27492749
retval=nl;
27502750

27512751
foreach(l,lnext(list))
27522752
{
2753-
lnext(nl)=lcons(copyObject(lfirst(l)),NIL);
2753+
lnext(nl)=makeList1(copyObject(lfirst(l)));
27542754
nl=lnext(nl);
27552755
}
27562756
}

‎src/backend/nodes/list.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.36 2000/10/31 10:22:10 petere Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.37 2001/01/17 17:26:44 momjian Exp $
1212
*
1313
* NOTES
1414
* XXX a few of the following functions are duplicated to handle
@@ -127,7 +127,7 @@ lconsi(int datum, List *list)
127127
List*
128128
lappend(List*list,void*obj)
129129
{
130-
returnnconc(list,lcons(obj,NIL));
130+
returnnconc(list,makeList1(obj));
131131
}
132132

133133
/*
@@ -138,7 +138,7 @@ lappend(List *list, void *obj)
138138
List*
139139
lappendi(List*list,intdatum)
140140
{
141-
returnnconc(list,lconsi(datum,NIL));
141+
returnnconc(list,makeListi1(datum));
142142
}
143143

144144
/*

‎src/backend/nodes/makefuncs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/nodes/makefuncs.c,v 1.23 2000/11/16 22:30:23 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/nodes/makefuncs.c,v 1.24 2001/01/17 17:26:44 momjian Exp $
1212
*
1313
* NOTES
1414
* Creator functions in POSTGRES 4.2 are generated automatically. Most of
@@ -178,7 +178,7 @@ makeAttr(char *relname, char *attname)
178178
a->relname=pstrdup(relname);
179179
a->paramNo=NULL;
180180
if (attname!=NULL)
181-
a->attrs=lcons(makeString(pstrdup(attname)),NIL);
181+
a->attrs=makeList1(makeString(pstrdup(attname)));
182182
a->indirection=NULL;
183183

184184
returna;

‎src/backend/optimizer/geqo/geqo_eval.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: geqo_eval.c,v 1.55 2000/09/19 18:42:33 tgl Exp $
9+
* $Id: geqo_eval.c,v 1.56 2001/01/17 17:26:44 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -122,7 +122,7 @@ gimme_tree(Query *root, List *initial_rels,
122122
else
123123
{
124124
/* tree main part */
125-
List*acceptable_rels=lcons(inner_rel,NIL);
125+
List*acceptable_rels=makeList1(inner_rel);
126126
List*new_rels;
127127
RelOptInfo*new_rel;
128128

‎src/backend/optimizer/path/_deadcode/xfunc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/_deadcode/Attic/xfunc.c,v 1.13 2000/01/26 05:56:36 momjian Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/_deadcode/Attic/xfunc.c,v 1.14 2001/01/17 17:26:45 momjian Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -300,7 +300,7 @@ xfunc_pullup(Query *queryInfo,
300300
get_clause(cinfo),LispNil);
301301
xfunc_copyrel(get_parent(newkid),&newrel);
302302
set_parent(newkid,newrel);
303-
set_pathlist(newrel,lcons(newkid,NIL));
303+
set_pathlist(newrel,makeList1(newkid));
304304
set_unorderedpath(newrel, (PathPtr)newkid);
305305
set_cheapestpath(newrel, (PathPtr)newkid);
306306
set_size(newrel,

‎src/backend/optimizer/path/pathkeys.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Portions Copyright (c) 1994, Regents of the University of California
1212
*
1313
* IDENTIFICATION
14-
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/pathkeys.c,v 1.28 2000/12/14 22:30:43 tgl Exp $
14+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/pathkeys.c,v 1.29 2001/01/17 17:26:45 momjian Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -119,7 +119,7 @@ add_equijoined_keys(Query *root, RestrictInfo *restrictinfo)
119119

120120
/* Build the new set only when we know we must */
121121
if (newset==NIL)
122-
newset=lcons(item1,lcons(item2,NIL));
122+
newset=makeList2(item1,item2);
123123

124124
/* Found a set to merge into our new set */
125125
newset=set_union(newset,curset);
@@ -135,7 +135,7 @@ add_equijoined_keys(Query *root, RestrictInfo *restrictinfo)
135135

136136
/* Build the new set only when we know we must */
137137
if (newset==NIL)
138-
newset=lcons(item1,lcons(item2,NIL));
138+
newset=makeList2(item1,item2);
139139

140140
root->equi_key_list=lcons(newset,root->equi_key_list);
141141
}
@@ -534,7 +534,7 @@ build_index_pathkeys(Query *root,
534534
/* Make a one-sublist pathkeys list for the function expression */
535535
item=makePathKeyItem((Node*)make_funcclause(funcnode,funcargs),
536536
sortop);
537-
retval=lcons(make_canonical_pathkey(root,item),NIL);
537+
retval=makeList1(make_canonical_pathkey(root,item));
538538
}
539539
else
540540
{
@@ -678,7 +678,7 @@ make_pathkeys_for_sortclauses(List *sortclauses,
678678
* canonicalize_pathkeys() might replace it with a longer sublist
679679
* later.
680680
*/
681-
pathkeys=lappend(pathkeys,lcons(pathkey,NIL));
681+
pathkeys=lappend(pathkeys,makeList1(pathkey));
682682
}
683683
returnpathkeys;
684684
}

‎src/backend/optimizer/prep/prepunion.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
*
1616
* IDENTIFICATION
17-
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.58 2000/12/14 22:30:44 tgl Exp $
17+
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.59 2001/01/17 17:26:45 momjian Exp $
1818
*
1919
*-------------------------------------------------------------------------
2020
*/
@@ -467,7 +467,7 @@ List *
467467
find_all_inheritors(Oidparentrel)
468468
{
469469
List*examined_relids=NIL;
470-
List*unexamined_relids=lconsi(parentrel,NIL);
470+
List*unexamined_relids=makeListi1(parentrel);
471471

472472
/*
473473
* While the queue of unexamined relids is nonempty, remove the first

‎src/backend/parser/gram.y

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.215 2001/01/15 20:36:36 tgl Exp $
14+
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.216 2001/01/17 17:26:45 momjian Exp $
1515
*
1616
* HISTORY
1717
* AUTHORDATEMAJOR EVENT
@@ -2918,15 +2918,15 @@ createdb_opt_item: LOCATION '=' Sconst
29182918
}
29192919
|LOCATION'='DEFAULT
29202920
{
2921-
$$ = lconsi(1, makeList1((char *)NULL));
2921+
$$ = lconsi(1, makeList1(NULL));
29222922
}
29232923
|TEMPLATE'='name
29242924
{
29252925
$$ = lconsi(2, makeList1($3));
29262926
}
29272927
|TEMPLATE'='DEFAULT
29282928
{
2929-
$$ = lconsi(2, makeList1((char *)NULL));
2929+
$$ = lconsi(2, makeList1(NULL));
29302930
}
29312931
|ENCODING'='Sconst
29322932
{
@@ -3383,7 +3383,7 @@ simple_select: SELECT opt_distinct target_list
33833383

33843384
/* easy way to return two values. Can someone improve this? bjm*/
33853385
into_clause:INTOOptTempTableName{$$ =$2; }
3386-
|/*EMPTY*/{$$ =lcons(makeInteger(FALSE), NIL); }
3386+
|/*EMPTY*/{$$ =makeList1(makeInteger(FALSE)); }
33873387
;
33883388

33893389
/*

‎src/backend/parser/parse_coerce.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.52 2000/12/1704:32:29 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.53 2001/01/1717:26:45 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -128,7 +128,7 @@ coerce_type(ParseState *pstate, Node *node, Oid inputTypeId,
128128
FuncCall*n=makeNode(FuncCall);
129129

130130
n->funcname=typeidTypeName(targetTypeId);
131-
n->args=lcons(node,NIL);
131+
n->args=makeList1(node);
132132
n->agg_star= false;
133133
n->agg_distinct= false;
134134

@@ -304,7 +304,7 @@ coerce_type_typmod(ParseState *pstate, Node *node,
304304
cons->val.val.ival=atttypmod;
305305

306306
func->funcname=funcname;
307-
func->args=lappend(lcons(node,NIL),cons);
307+
func->args=makeList2(node,cons);
308308
func->agg_star= false;
309309
func->agg_distinct= false;
310310

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp