Re: Propose a new function - list_is_empty

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Smith <smithpb2250@gmail.com>
Cc: Junwang Zhao <zhjwpku@gmail.com>, Daniel Gustafsson <daniel@yesql.se>, Robert Haas <robertmhaas@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-08-17T15:14:12Z
Lists: pgsql-hackers
I wrote:
> I'd drop the parens in these particular examples because they are
> inconsistent with the other parts of the same "if" condition.

After going through the patch I removed most but not all of the
newly-added parens on those grounds.  I also found a couple more
spots that could be converted.  Pushed with those changes.

			regards, tom lane



Commits

  1. Avoid using list_length() to test for empty list.