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

Commitba0f38d

Browse files
committed
FastList is history, yay.
1 parentaad4196 commitba0f38d

File tree

2 files changed

+24
-114
lines changed

2 files changed

+24
-114
lines changed

‎src/backend/nodes/list.c

Lines changed: 4 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/nodes/list.c,v 1.58 2004/05/30 23:40:27 neilc Exp $
12+
* $PostgreSQL: pgsql/src/backend/nodes/list.c,v 1.59 2004/06/01 06:02:12 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
1616
#include"postgres.h"
17+
1718
#include"nodes/pg_list.h"
1819

20+
1921
/*
2022
* Routines to simplify writing assertions about the type of a list; a
2123
* NIL list is considered to be an empty list of any type.
@@ -1069,7 +1071,7 @@ list_length(List *l)
10691071
*
10701072
* In order to avoid warnings for these function definitions, we need
10711073
* to include a prototype here as well as in pg_list.h. That's because
1072-
* weexplicitly disable list API compatibility in list.c, so we
1074+
* wedon't enable list API compatibility in list.c, so we
10731075
* don't see the prototypes for these functions.
10741076
*/
10751077

@@ -1087,80 +1089,3 @@ length(List *list)
10871089
{
10881090
returnlist_length(list);
10891091
}
1090-
1091-
/*
1092-
* This code implements the old "Fast List" API, making use of the new
1093-
* List code to do so. There's no need for FastList anymore, so this
1094-
* code is a bit sloppy -- it will be removed soon.
1095-
*/
1096-
voidFastListInit(FastList*fl);
1097-
1098-
void
1099-
FastListInit(FastList*fl)
1100-
{
1101-
fl->list=NIL;
1102-
}
1103-
1104-
voidFastListFromList(FastList*fl,List*l);
1105-
1106-
void
1107-
FastListFromList(FastList*fl,List*list)
1108-
{
1109-
fl->list=list;
1110-
}
1111-
1112-
List*FastListValue(FastList*fl);
1113-
1114-
List*
1115-
FastListValue(FastList*fl)
1116-
{
1117-
returnfl->list;
1118-
}
1119-
1120-
voidmakeFastList1(FastList*fl,void*elem);
1121-
1122-
void
1123-
makeFastList1(FastList*fl,void*elem)
1124-
{
1125-
fl->list=list_make1(elem);
1126-
}
1127-
1128-
voidFastAppend(FastList*fl,void*datum);
1129-
1130-
void
1131-
FastAppend(FastList*fl,void*datum)
1132-
{
1133-
fl->list=lappend(fl->list,datum);
1134-
}
1135-
1136-
voidFastAppendi(FastList*fl,intdatum);
1137-
1138-
void
1139-
FastAppendi(FastList*fl,intdatum)
1140-
{
1141-
fl->list=lappend_int(fl->list,datum);
1142-
}
1143-
1144-
voidFastAppendo(FastList*fl,Oiddatum);
1145-
1146-
void
1147-
FastAppendo(FastList*fl,Oiddatum)
1148-
{
1149-
fl->list=lappend_oid(fl->list,datum);
1150-
}
1151-
1152-
voidFastConc(FastList*fl,List*cells);
1153-
1154-
void
1155-
FastConc(FastList*fl,List*cells)
1156-
{
1157-
fl->list=list_concat(fl->list,cells);
1158-
}
1159-
1160-
voidFastConcFast(FastList*fl1,FastList*fl2);
1161-
1162-
void
1163-
FastConcFast(FastList*fl1,FastList*fl2)
1164-
{
1165-
fl1->list=list_concat(fl1->list,fl2->list);
1166-
}

‎src/include/nodes/pg_list.h

Lines changed: 20 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,9 @@
33
* pg_list.h
44
* interface for PostgreSQL generic linked list package
55
*
6+
* This package implements singly-linked homogeneous lists.
67
*
7-
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
8-
* Portions Copyright (c) 1994, Regents of the University of California
9-
*
10-
* $PostgreSQL: pgsql/src/include/nodes/pg_list.h,v 1.46 2004/05/30 23:40:39 neilc Exp $
11-
*
12-
*-------------------------------------------------------------------------
13-
*/
14-
#ifndefPG_LIST_H
15-
#definePG_LIST_H
16-
17-
#include"nodes/nodes.h"
18-
19-
/*
20-
* This package implements singly-linked homogeneous lists. It is
21-
* important to have constant-time length, append, and prepend
8+
* It is important to have constant-time length, append, and prepend
229
* operations. To achieve this, we deal with two distinct data
2310
* structures:
2411
*
@@ -38,7 +25,20 @@
3825
*
3926
* (At the moment, ints and Oids are the same size, but they may not
4027
* always be so; try to be careful to maintain the distinction.)
28+
*
29+
*
30+
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
31+
* Portions Copyright (c) 1994, Regents of the University of California
32+
*
33+
* $PostgreSQL: pgsql/src/include/nodes/pg_list.h,v 1.47 2004/06/01 06:02:13 tgl Exp $
34+
*
35+
*-------------------------------------------------------------------------
4136
*/
37+
#ifndefPG_LIST_H
38+
#definePG_LIST_H
39+
40+
#include"nodes/nodes.h"
41+
4242

4343
typedefstructListCellListCell;
4444

@@ -107,7 +107,7 @@ extern int list_length(List *l);
107107
* the List API: the macro lfirst() was used to mean "the data in this
108108
* cons cell". To avoid changing every usage of lfirst(), that meaning
109109
* has been kept. As a result, lfirst() takes a ListCell and returns
110-
* the data it contains; to get the data in the_first_ cell of a
110+
* the data it contains; to get the data in thefirst cell of a
111111
* List, use linitial(). Worse, lsecond() is more closely related to
112112
* linitial() than lfirst(): given a List, lsecond() returns the data
113113
* in the second cons cell.
@@ -122,10 +122,6 @@ extern int list_length(List *l);
122122
#definelinitial_int(l)lfirst_int(list_head(l))
123123
#definelinitial_oid(l)lfirst_oid(list_head(l))
124124

125-
#definellast(l)lfirst(list_tail(l))
126-
#definellast_int(l)lfirst_int(list_tail(l))
127-
#definellast_oid(l)lfirst_oid(list_tail(l))
128-
129125
#definelsecond(l)lfirst(lnext(list_head(l)))
130126
#definelsecond_int(l)lfirst_int(lnext(list_head(l)))
131127
#definelsecond_oid(l)lfirst_oid(lnext(list_head(l)))
@@ -138,6 +134,10 @@ extern int list_length(List *l);
138134
#definelfourth_int(l)lfirst_int(lnext(lnext(lnext(list_head(l)))))
139135
#definelfourth_oid(l)lfirst_oid(lnext(lnext(lnext(list_head(l)))))
140136

137+
#definellast(l)lfirst(list_tail(l))
138+
#definellast_int(l)lfirst_int(list_tail(l))
139+
#definellast_oid(l)lfirst_oid(list_tail(l))
140+
141141
/*
142142
* Convenience macros for building fixed-length lists
143143
*/
@@ -301,19 +301,4 @@ extern int length(List *list);
301301

302302
#endif/* ENABLE_LIST_COMPAT */
303303

304-
typedefstructFastList
305-
{
306-
List*list;
307-
}FastList;
308-
309-
externvoidFastListInit(FastList*fl);
310-
externvoidFastListFromList(FastList*fl,List*list);
311-
externList*FastListValue(FastList*fl);
312-
externvoidmakeFastList1(FastList*fl,void*elem);
313-
externvoidFastAppend(FastList*fl,void*datum);
314-
externvoidFastAppendi(FastList*fl,intdatum);
315-
externvoidFastAppendo(FastList*fl,Oiddatum);
316-
externvoidFastConc(FastList*fl,List*cells);
317-
externvoidFastConcFast(FastList*fl1,FastList*fl2);
318-
319304
#endif/* PG_LIST_H */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp