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

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Smith <smithpb2250(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: strange case of "if ((a & b))"
Date: 2021-09-09 04:28:54
Message-ID: YTmNhnRFkT/KjDQ+@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Sep 07, 2021 at 02:59:58PM +0900, Michael Paquier wrote:
> In 0002, everything is a boolean expression except for
> SpGistPageStoresNulls() and GistPageIsLeaf(). So that's a good
> cleanup overall.

I looked again at 0002 again yesterday, and that was an improvement
for most of those locations, where we already use a boolean as
expression, so done mostly as of fd0625c.

> - pathnode->parallel_aware = parallel_workers > 0 ? true : false;
> + pathnode->parallel_aware = parallel_workers > 0;
> I also prefer that we keep the parenthesis for such things. That's
> more readable and easier to reason about.

Adjusted these as well.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2021-09-09 04:34:14 Re: drop tablespace failed when location contains .. on win32
Previous Message Michael Paquier 2021-09-09 04:23:10 Re: Estimating HugePages Requirements?