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

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Justin Pryzby <pryzby@telsasoft.com>, Kyotaro Horiguchi <horikyota.ntt@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Peter Smith <smithpb2250@gmail.com>, Bruce Momjian <bruce@momjian.us>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-10-07T07:49:10Z
Lists: pgsql-hackers
On Thu, Oct 07, 2021 at 03:24:53PM +0900, Masahiko Sawada wrote:
> Indeed. I've attached a patch that also deals with "false : true" cases.

Looks right.  I would be tempted to keep the one in readfuncs.c
though, mostly as a matter of style, and I would add a comparison with
NULL for the return result of bsearch() in ts_utils.c.
--
Michael

Commits

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

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