1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-24 09:27:52 +03:00

Change lcons(x, NIL) to makeList(x) where appropriate.

This commit is contained in:
Bruce Momjian
2001-01-17 17:26:45 +00:00
parent 8e9840383c
commit 5088f0748a
12 changed files with 36 additions and 35 deletions

View File

@@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.136 2001/01/05 06:34:17 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.137 2001/01/17 17:26:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -58,11 +58,11 @@ listCopy(List *list)
if (list == NIL)
return NIL;
newlist = nl = lcons(lfirst(list), NIL);
newlist = nl = makeList1(lfirst(list));
foreach(l, lnext(list))
{
lnext(nl) = lcons(lfirst(l), NIL);
lnext(nl) = makeList1(lfirst(l));
nl = lnext(nl);
}
return newlist;
@@ -2745,12 +2745,12 @@ copyObject(void *from)
/* rather ugly coding for speed... */
/* Note the input list cannot be NIL if we got here. */
nl = lcons(copyObject(lfirst(list)), NIL);
nl = makeList1(copyObject(lfirst(list)));
retval = nl;
foreach(l, lnext(list))
{
lnext(nl) = lcons(copyObject(lfirst(l)), NIL);
lnext(nl) = makeList1(copyObject(lfirst(l)));
nl = lnext(nl);
}
}

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.36 2000/10/31 10:22:10 petere Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.37 2001/01/17 17:26:44 momjian Exp $
*
* NOTES
* XXX a few of the following functions are duplicated to handle
@@ -127,7 +127,7 @@ lconsi(int datum, List *list)
List *
lappend(List *list, void *obj)
{
return nconc(list, lcons(obj, NIL));
return nconc(list, makeList1(obj));
}
/*
@@ -138,7 +138,7 @@ lappend(List *list, void *obj)
List *
lappendi(List *list, int datum)
{
return nconc(list, lconsi(datum, NIL));
return nconc(list, makeListi1(datum));
}
/*

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/makefuncs.c,v 1.23 2000/11/16 22:30:23 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/makefuncs.c,v 1.24 2001/01/17 17:26:44 momjian Exp $
*
* NOTES
* Creator functions in POSTGRES 4.2 are generated automatically. Most of
@@ -178,7 +178,7 @@ makeAttr(char *relname, char *attname)
a->relname = pstrdup(relname);
a->paramNo = NULL;
if (attname != NULL)
a->attrs = lcons(makeString(pstrdup(attname)), NIL);
a->attrs = makeList1(makeString(pstrdup(attname)));
a->indirection = NULL;
return a;