1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-16 06:01:02 +03:00

Use l*_node() family of functions where appropriate

Instead of castNode(…, lfoo(…))

Author: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Discussion: https://www.postgresql.org/message-id/flat/87eecahraj.fsf@wibble.ilmari.org
This commit is contained in:
Peter Eisentraut
2021-07-19 08:01:40 +02:00
parent 29abde637b
commit 2b00db4fb0
13 changed files with 33 additions and 33 deletions

View File

@ -2424,7 +2424,7 @@ transformIndexConstraint(Constraint *constraint, CreateStmtContext *cxt)
/* Make sure referenced column exists. */
foreach(columns, cxt->columns)
{
column = castNode(ColumnDef, lfirst(columns));
column = lfirst_node(ColumnDef, columns);
if (strcmp(column->colname, key) == 0)
{
found = true;
@ -2462,7 +2462,7 @@ transformIndexConstraint(Constraint *constraint, CreateStmtContext *cxt)
foreach(inher, cxt->inhRelations)
{
RangeVar *inh = castNode(RangeVar, lfirst(inher));
RangeVar *inh = lfirst_node(RangeVar, inher);
Relation rel;
int count;
@ -4088,7 +4088,7 @@ transformPartitionBound(ParseState *pstate, Relation parent,
duplicate = false;
foreach(cell2, result_spec->listdatums)
{
Const *value2 = castNode(Const, lfirst(cell2));
Const *value2 = lfirst_node(Const, cell2);
if (equal(value, value2))
{
@ -4267,7 +4267,7 @@ validateInfiniteBounds(ParseState *pstate, List *blist)
foreach(lc, blist)
{
PartitionRangeDatum *prd = castNode(PartitionRangeDatum, lfirst(lc));
PartitionRangeDatum *prd = lfirst_node(PartitionRangeDatum, lc);
if (kind == prd->kind)
continue;