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

Commitceb233e

Browse files
committed
more cleanup
1 parent1ed5cbb commitceb233e

File tree

2 files changed

+80
-7
lines changed

2 files changed

+80
-7
lines changed

‎src/backend/nodes/list.c

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.18 1999/02/2205:26:18 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.19 1999/02/2206:08:47 momjian Exp $
1111
*
1212
* NOTES
1313
* XXX a few of the following functions are duplicated to handle
@@ -29,6 +29,11 @@
2929
#include"utils/elog.h"
3030
#include"utils/palloc.h"
3131

32+
/*
33+
*makeList
34+
*
35+
*Take varargs, terminated by -1, and make a List
36+
*/
3237
List*
3338
makeList(void*elem,...)
3439
{
@@ -57,6 +62,11 @@ makeList(void *elem,...)
5762
returnretval;
5863
}
5964

65+
/*
66+
*lcons
67+
*
68+
*Add obj to the front of list, or make a new list if 'list' is NIL
69+
*/
6070
List*
6171
lcons(void*obj,List*list)
6272
{
@@ -67,6 +77,11 @@ lcons(void *obj, List *list)
6777
returnl;
6878
}
6979

80+
/*
81+
*lconsi
82+
*
83+
*Same as lcons, but for integer data
84+
*/
7085
List*
7186
lconsi(intdatum,List*list)
7287
{
@@ -77,18 +92,35 @@ lconsi(int datum, List *list)
7792
returnl;
7893
}
7994

95+
/*
96+
*lappend
97+
*
98+
*Add obj to the end of list, or make a new list if 'list' is NIL
99+
*
100+
* MORE EXPENSIVE THAN lcons
101+
*/
80102
List*
81103
lappend(List*list,void*obj)
82104
{
83105
returnnconc(list,lcons(obj,NIL));
84106
}
85107

108+
/*
109+
*lappendi
110+
*
111+
*Same as lappend, but for integers
112+
*/
86113
List*
87114
lappendi(List*list,intdatum)
88115
{
89116
returnnconc(list,lconsi(datum,NIL));
90117
}
91118

119+
/*
120+
*nconc
121+
*
122+
*Concat l2 on to the end of l1
123+
*/
92124
List*
93125
nconc(List*l1,List*l2)
94126
{
@@ -131,6 +163,9 @@ nreverse(List *list)
131163
}
132164
#endif
133165

166+
/*
167+
*makeInteger
168+
*/
134169
Value*
135170
makeInteger(longi)
136171
{
@@ -141,6 +176,9 @@ makeInteger(long i)
141176
returnv;
142177
}
143178

179+
/*
180+
*makeFloat
181+
*/
144182
Value*
145183
makeFloat(doubled)
146184
{
@@ -151,6 +189,9 @@ makeFloat(double d)
151189
returnv;
152190
}
153191

192+
/*
193+
*makeString
194+
*/
154195
Value*
155196
makeString(char*str)
156197
{
@@ -161,7 +202,11 @@ makeString(char *str)
161202
returnv;
162203
}
163204

164-
/* n starts with 0 */
205+
/*
206+
*nth
207+
*
208+
*Get the n'th element of the list. First element is 0th.
209+
*/
165210
void*
166211
nth(intn,List*l)
167212
{
@@ -174,6 +219,11 @@ nth(int n, List *l)
174219
returnlfirst(l);
175220
}
176221

222+
/*
223+
*nthi
224+
*
225+
*Same as nthi, but for integers
226+
*/
177227
int
178228
nthi(intn,List*l)
179229
{
@@ -200,6 +250,11 @@ set_nth(List *l, int n, void *elem)
200250
return;
201251
}
202252

253+
/*
254+
*length
255+
*
256+
*Get the length of l
257+
*/
203258
int
204259
length(List*l)
205260
{
@@ -213,6 +268,11 @@ length(List *l)
213268
returni;
214269
}
215270

271+
/*
272+
*freeList
273+
*
274+
*Free the List nodes of a list
275+
*/
216276
void
217277
freeList(List*list)
218278
{
@@ -415,6 +475,9 @@ lremove(void *elem, List *list)
415475
returnresult;
416476
}
417477

478+
/*
479+
*LispRemove
480+
*/
418481
List*
419482
LispRemove(void*elem,List*list)
420483
{
@@ -466,6 +529,11 @@ intLispRemove(int elem, List *list)
466529

467530
#endif
468531

532+
/*
533+
*set_difference
534+
*
535+
*Return l1 without the elements in l2.
536+
*/
469537
List*
470538
set_difference(List*l1,List*l2)
471539
{
@@ -483,6 +551,11 @@ set_difference(List *l1, List *l2)
483551
returnresult;
484552
}
485553

554+
/*
555+
*set_differencei
556+
*
557+
*Same as set_difference, but for integers
558+
*/
486559
List*
487560
set_differencei(List*l1,List*l2)
488561
{

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

Lines changed: 5 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/path/joinrels.c,v 1.31 1999/02/2205:26:20 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.32 1999/02/2206:08:48 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -61,7 +61,7 @@ make_rels_by_joins(Query *root, List *old_rels)
6161
*/
6262
joined_rels=make_rels_by_clauseless_joins(old_rel,
6363
root->base_rel_list);
64-
joined_rels=append(joined_rels,
64+
joined_rels=nconc(joined_rels,
6565
make_rels_by_clauseless_joins(old_rel,
6666
old_rels));
6767
}
@@ -236,10 +236,10 @@ make_join_rel(RelOptInfo *outer_rel, RelOptInfo *inner_rel, JoinInfo *joininfo)
236236
joinrel->restrictinfo=joininfo->jinfo_restrictinfo;
237237

238238
joinrel_joininfo_list=new_joininfo_list(
239-
append(outer_rel->joininfo,
240-
inner_rel->joininfo),
239+
nconc(copyObject(outer_rel->joininfo),
240+
copyObject(inner_rel->joininfo)),
241241
nconc(listCopy(outer_rel->relids),
242-
listCopy(inner_rel->relids)));
242+
listCopy(inner_rel->relids)));
243243

244244
joinrel->joininfo=joinrel_joininfo_list;
245245

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp