mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-24 18:55:04 +08:00
Minor mop-up for List improvements.
Fix a few places that were using written-out versions of the
pg_list.h macros that commit cc99baa43
just improved, making them
also use those macros so as to gain whatever performance improvement
is to be had.
Discussion: https://postgr.es/m/CAApHDvpo1zj9KhEpU2cCRZfSM3Q6XGdhzuAS2v79PH7WJBkYVA@mail.gmail.com
This commit is contained in:
parent
0baf82fa0c
commit
9d299a4924
@ -1506,7 +1506,7 @@ get_object_address_attribute(ObjectType objtype, List *object,
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_SYNTAX_ERROR),
|
||||
errmsg("column name must be qualified")));
|
||||
attname = strVal(lfirst(list_tail(object)));
|
||||
attname = strVal(llast(object));
|
||||
relname = list_truncate(list_copy(object), list_length(object) - 1);
|
||||
/* XXX no missing_ok support here */
|
||||
relation = relation_openrv(makeRangeVarFromNameList(relname), lockmode);
|
||||
|
@ -1668,7 +1668,7 @@ process_owned_by(Relation seqrel, List *owned_by, bool for_identity)
|
||||
|
||||
/* Separate relname and attr name */
|
||||
relname = list_truncate(list_copy(owned_by), nnames - 1);
|
||||
attrname = strVal(lfirst(list_tail(owned_by)));
|
||||
attrname = strVal(llast(owned_by));
|
||||
|
||||
/* Open and lock rel to ensure it won't go away meanwhile */
|
||||
rel = makeRangeVarFromNameList(relname);
|
||||
|
@ -327,7 +327,7 @@ lappend(List *list, void *datum)
|
||||
else
|
||||
new_tail_cell(list);
|
||||
|
||||
lfirst(list_tail(list)) = datum;
|
||||
llast(list) = datum;
|
||||
check_list_invariants(list);
|
||||
return list;
|
||||
}
|
||||
@ -345,7 +345,7 @@ lappend_int(List *list, int datum)
|
||||
else
|
||||
new_tail_cell(list);
|
||||
|
||||
lfirst_int(list_tail(list)) = datum;
|
||||
llast_int(list) = datum;
|
||||
check_list_invariants(list);
|
||||
return list;
|
||||
}
|
||||
@ -363,7 +363,7 @@ lappend_oid(List *list, Oid datum)
|
||||
else
|
||||
new_tail_cell(list);
|
||||
|
||||
lfirst_oid(list_tail(list)) = datum;
|
||||
llast_oid(list) = datum;
|
||||
check_list_invariants(list);
|
||||
return list;
|
||||
}
|
||||
@ -459,7 +459,7 @@ lcons(void *datum, List *list)
|
||||
else
|
||||
new_head_cell(list);
|
||||
|
||||
lfirst(list_head(list)) = datum;
|
||||
linitial(list) = datum;
|
||||
check_list_invariants(list);
|
||||
return list;
|
||||
}
|
||||
@ -477,7 +477,7 @@ lcons_int(int datum, List *list)
|
||||
else
|
||||
new_head_cell(list);
|
||||
|
||||
lfirst_int(list_head(list)) = datum;
|
||||
linitial_int(list) = datum;
|
||||
check_list_invariants(list);
|
||||
return list;
|
||||
}
|
||||
@ -495,7 +495,7 @@ lcons_oid(Oid datum, List *list)
|
||||
else
|
||||
new_head_cell(list);
|
||||
|
||||
lfirst_oid(list_head(list)) = datum;
|
||||
linitial_oid(list) = datum;
|
||||
check_list_invariants(list);
|
||||
return list;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user