Re: strange case of "if ((a & b))"

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

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2021-04-28T18:40:09Z
Lists: pgsql-hackers
Justin Pryzby <pryzby@telsasoft.com> writes:
> These look strange to me - the inner parens don't do anything.
> I wouldn't write it with 2x parens for the same reason I wouldn't write it with
> 8x parens.

Agreed, but shouldn't we just drop the excess parens rather than
doubling down on useless notation?

			regards, tom lane



Commits

  1. Clean up more code using "(expr) ? true : false"

  2. Clean up some code using "(expr) ? true : false"