mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-10 18:43:23 +02:00
efd0c16bec
The standard way to check for list emptiness is to compare the List pointer to NIL; our list code goes out of its way to ensure that that is the only representation of an empty list. (An acceptable alternative is a plain boolean test for non-null pointer, but explicit mention of NIL is usually preferable.) Various places didn't get that memo and expressed the condition with list_length(), which might not be so bad except that there were such a variety of ways to check it exactly: equal to zero, less than or equal to zero, less than one, yadda yadda. In the name of code readability, let's standardize all those spellings as "list == NIL" or "list != NIL". (There's probably some microscopic efficiency gain too, though few of these look to be at all performance-critical.) A very small number of cases were left as-is because they seemed more consistent with other adjacent list_length tests that way. Peter Smith, with bikeshedding from a number of us Discussion: https://postgr.es/m/CAHut+PtQYe+ENX5KrONMfugf0q6NHg4hR5dAhqEXEc2eefFeig@mail.gmail.com |
||
---|---|---|
.. | ||
.gitignore | ||
aclchk.c | ||
catalog.c | ||
Catalog.pm | ||
dependency.c | ||
genbki.pl | ||
heap.c | ||
index.c | ||
indexing.c | ||
information_schema.sql | ||
Makefile | ||
namespace.c | ||
objectaccess.c | ||
objectaddress.c | ||
partition.c | ||
pg_aggregate.c | ||
pg_attrdef.c | ||
pg_cast.c | ||
pg_class.c | ||
pg_collation.c | ||
pg_constraint.c | ||
pg_conversion.c | ||
pg_db_role_setting.c | ||
pg_depend.c | ||
pg_enum.c | ||
pg_inherits.c | ||
pg_largeobject.c | ||
pg_namespace.c | ||
pg_operator.c | ||
pg_parameter_acl.c | ||
pg_proc.c | ||
pg_publication.c | ||
pg_range.c | ||
pg_shdepend.c | ||
pg_subscription.c | ||
pg_type.c | ||
sql_feature_packages.txt | ||
sql_features.txt | ||
storage.c | ||
system_functions.sql | ||
system_views.sql | ||
toasting.c |