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

Commit944d3c3

Browse files
committed
Replace non-idiomatic nconc(x, lcons(y, NIL)) with lappend(x, y).
1 parentdec354c commit944d3c3

File tree

7 files changed

+39
-64
lines changed

7 files changed

+39
-64
lines changed

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

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Copyright (c) 1994, Regents of the University of California
77
*
8-
* $Id: geqo_eval.c,v 1.30 1999/02/1404:56:45 momjian Exp $
8+
* $Id: geqo_eval.c,v 1.31 1999/02/15 02:04:58 tgl Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -337,24 +337,21 @@ new_join_tlist(List *tlist,
337337
{
338338
intresdomno=first_resdomno-1;
339339
TargetEntry*xtl=NULL;
340-
List*temp_node=NIL;
341340
List*t_list=NIL;
342341
List*i=NIL;
343342
List*join_list=NIL;
344343
boolin_final_tlist= false;
345344

346-
347345
foreach(i,tlist)
348346
{
349347
xtl=lfirst(i);
348+
/* XXX surely this is wrong? join_list is never changed? tgl 2/99 */
350349
in_final_tlist= (join_list==NIL);
351350
if (in_final_tlist)
352351
{
353352
resdomno+=1;
354-
temp_node=lcons(create_tl_element(get_expr(xtl),
355-
resdomno),
356-
NIL);
357-
t_list=nconc(t_list,temp_node);
353+
t_list=lappend(t_list,
354+
create_tl_element(get_expr(xtl),resdomno));
358355
}
359356
}
360357

@@ -590,7 +587,6 @@ static List *
590587
geqo_final_join_rels(List*join_rel_list)
591588
{
592589
List*xrel=NIL;
593-
List*temp=NIL;
594590
List*t_list=NIL;
595591

596592
/*
@@ -615,8 +611,7 @@ geqo_final_join_rels(List *join_rel_list)
615611
}
616612
if (final)
617613
{
618-
temp=lcons(rel,NIL);
619-
t_list=nconc(t_list,temp);
614+
t_list=lappend(t_list,rel);
620615
}
621616
}
622617

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Copyright (c) 1994, Regents of the University of California
77
*
8-
* $Id: geqo_paths.c,v 1.20 1999/02/13 23:16:11 momjian Exp $
8+
* $Id: geqo_paths.c,v 1.21 1999/02/15 02:04:58 tgl Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -66,10 +66,9 @@ geqo_prune_rels(List *rel_list)
6666
staticList*
6767
geqo_prune_rel(RelOptInfo*rel,List*other_rels)
6868
{
69-
List*i=NIL;
7069
List*t_list=NIL;
71-
List*temp_node=NIL;
72-
RelOptInfo*other_rel= (RelOptInfo*)NULL;
70+
List*i;
71+
RelOptInfo*other_rel;
7372

7473
foreach(i,other_rels)
7574
{
@@ -79,12 +78,10 @@ geqo_prune_rel(RelOptInfo *rel, List *other_rels)
7978
rel->pathlist=add_pathlist(rel,
8079
rel->pathlist,
8180
other_rel->pathlist);
82-
t_list=nconc(t_list,NIL);/* XXX is this right ? */
8381
}
8482
else
8583
{
86-
temp_node=lcons(other_rel,NIL);
87-
t_list=nconc(t_list,temp_node);
84+
t_list=lappend(t_list,other_rel);
8885
}
8986
}
9087
returnt_list;

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

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.45 1999/02/1501:06:57 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.46 1999/02/1502:04:55 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -170,14 +170,13 @@ find_index_paths(Query *root,
170170

171171
if (joinclausegroups!=NIL)
172172
{
173-
List*new_join_paths=create_index_paths(root,rel,
174-
index,
175-
joinclausegroups,
176-
true);
177-
List*innerjoin_paths=index_innerjoin(root,rel,joinclausegroups,index);
178-
179-
rel->innerjoin=nconc(rel->innerjoin,innerjoin_paths);
180-
joinpaths=new_join_paths;
173+
joinpaths=create_index_paths(root,rel,
174+
index,
175+
joinclausegroups,
176+
true);
177+
rel->innerjoin=nconc(rel->innerjoin,
178+
index_innerjoin(root,rel,
179+
joinclausegroups,index));
181180
}
182181

183182
/*
@@ -1360,7 +1359,6 @@ create_index_paths(Query *root,
13601359
foreach(i,clausegroup_list)
13611360
{
13621361
RestrictInfo*restrictinfo;
1363-
List*temp_node=NIL;
13641362
booltemp= true;
13651363

13661364
clausegroup=lfirst(i);
@@ -1377,8 +1375,7 @@ create_index_paths(Query *root,
13771375
if (!join||temp)
13781376
{/* restriction, ordering scan */
13791377
temp_path=create_index_path(root,rel,index,clausegroup,join);
1380-
temp_node=lcons(temp_path,NIL);
1381-
ip_list=nconc(ip_list,temp_node);
1378+
ip_list=lappend(ip_list,temp_path);
13821379
}
13831380
}
13841381
returnip_list;

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.25 1999/02/14 05:27:12 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.26 1999/02/15 02:04:57 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -422,7 +422,6 @@ match_unsorted_inner(RelOptInfo *joinrel,
422422
{
423423
Path*innerpath= (Path*)NULL;
424424
List*mp_list=NIL;
425-
List*temp_node=NIL;
426425
PathOrder*innerpath_ordering=NULL;
427426
Costtemp1=0.0;
428427
booltemp2= false;
@@ -482,7 +481,8 @@ match_unsorted_inner(RelOptInfo *joinrel,
482481
joinrel->targetlist,
483482
clauses);
484483

485-
temp_node=lcons(create_mergejoin_path(joinrel,
484+
mp_list=lappend(mp_list,
485+
create_mergejoin_path(joinrel,
486486
outerrel->size,
487487
innerrel->size,
488488
outerrel->width,
@@ -493,10 +493,7 @@ match_unsorted_inner(RelOptInfo *joinrel,
493493
xmergeinfo->m_ordering,
494494
matchedJoinClauses,
495495
outerkeys,
496-
NIL),
497-
NIL);
498-
499-
mp_list=nconc(mp_list,temp_node);
496+
NIL));
500497
}
501498
}
502499
}

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

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.21 1999/02/1404:56:47 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.22 1999/02/15 02:04:57 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -165,19 +165,17 @@ find_clauseless_joins(RelOptInfo *outer_rel, List *inner_rels)
165165
{
166166
RelOptInfo*inner_rel;
167167
List*t_list=NIL;
168-
List*temp_node=NIL;
169168
List*i=NIL;
170169

171170
foreach(i,inner_rels)
172171
{
173172
inner_rel= (RelOptInfo*)lfirst(i);
174173
if (nonoverlap_rels(inner_rel,outer_rel))
175174
{
176-
temp_node=lcons(init_join_rel(outer_rel,
177-
inner_rel,
178-
(JoinInfo*)NULL),
179-
NIL);
180-
t_list=nconc(t_list,temp_node);
175+
t_list=lappend(t_list,
176+
init_join_rel(outer_rel,
177+
inner_rel,
178+
(JoinInfo*)NULL));
181179
}
182180
}
183181

@@ -278,24 +276,21 @@ new_join_tlist(List *tlist,
278276
{
279277
intresdomno=first_resdomno-1;
280278
TargetEntry*xtl=NULL;
281-
List*temp_node=NIL;
282279
List*t_list=NIL;
283280
List*i=NIL;
284281
List*join_list=NIL;
285282
boolin_final_tlist= false;
286283

287-
288284
foreach(i,tlist)
289285
{
290286
xtl=lfirst(i);
287+
/* XXX surely this is wrong? join_list is never changed? tgl 2/99 */
291288
in_final_tlist= (join_list==NIL);
292289
if (in_final_tlist)
293290
{
294291
resdomno+=1;
295-
temp_node=lcons(create_tl_element(get_expr(xtl),
296-
resdomno),
297-
NIL);
298-
t_list=nconc(t_list,temp_node);
292+
t_list=lappend(t_list,
293+
create_tl_element(get_expr(xtl),resdomno));
299294
}
300295
}
301296

@@ -479,7 +474,6 @@ List *
479474
final_join_rels(List*join_rel_list)
480475
{
481476
List*xrel=NIL;
482-
List*temp=NIL;
483477
List*t_list=NIL;
484478

485479
/*
@@ -504,8 +498,7 @@ final_join_rels(List *join_rel_list)
504498
}
505499
if (final)
506500
{
507-
temp=lcons(rel,NIL);
508-
t_list=nconc(t_list,temp);
501+
t_list=lappend(t_list,rel);
509502
}
510503
}
511504

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/joinutils.c,v 1.20 1999/02/13 23:16:19 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/joinutils.c,v 1.21 1999/02/15 02:04:57 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -410,11 +410,10 @@ new_matching_subkeys(Var *subkey,
410410
List*join_rel_tlist,
411411
List*joinclauses)
412412
{
413-
Expr*joinclause=NULL;
414413
List*t_list=NIL;
415-
List*temp=NIL;
416-
List*i=NIL;
417-
Expr*tlist_other_var= (Expr*)NULL;
414+
Expr*joinclause;
415+
List*i;
416+
Expr*tlist_other_var;
418417

419418
foreach(i,joinclauses)
420419
{
@@ -436,8 +435,7 @@ new_matching_subkeys(Var *subkey,
436435
* am not sure of this.
437436
*/
438437

439-
temp=lcons(tlist_other_var,NIL);
440-
t_list=nconc(t_list,temp);
438+
t_list=lappend(t_list,tlist_other_var);
441439
}
442440
}
443441
returnt_list;

‎src/backend/optimizer/plan/createplan.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.47 1999/02/1501:06:58 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.48 1999/02/1502:04:55 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -385,8 +385,7 @@ create_indexscan_node(IndexPath *best_path,
385385
lcons(index_clause,NIL));
386386

387387
if (lossy)
388-
qpqual=nconc(qpqual,
389-
lcons((List*)copyObject(index_clause),NIL));
388+
qpqual=lappend(qpqual, (List*)copyObject(index_clause));
390389
}
391390
else
392391
{
@@ -1200,8 +1199,7 @@ generate_fjoin(List *tlist)
12001199
inner,
12011200
results,
12021201
alwaysDone);
1203-
tempList=lcons(fjoinNode,NIL);
1204-
tempList=nconc(tempList,fjoinList);
1202+
tempList=lcons(fjoinNode,fjoinList);
12051203
newTlist=lappend(newTlist,tempList);
12061204
}
12071205
returnnewTlist;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp