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

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2021-05-10T06:25:08Z
Lists: pgsql-hackers
On Wed, Apr 28, 2021 at 01:29:36PM -0500, Justin Pryzby wrote:
> 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.

>  				}
> -				else if ((!ctx->fast_forward))
> +				else if ((!ctx->fast_forward) != 0)

I find this part of the change harder to understand.
--
Michael

Commits

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

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