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

Поиск
Список
Период
Сортировка
От Masahiko Sawada
Тема Re: strange case of "if ((a & b))"
Дата
Msg-id CAD21AoCdF8dnUvr-BUWWGvA_XhKSoANacBMZb6jKyCk4TYfQ2Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: strange case of "if ((a & b))"  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
On Sat, Sep 11, 2021 at 2:44 PM Michael Paquier <michael@paquier.xyz> wrote:
>
> On Thu, Sep 09, 2021 at 02:14:50PM +0900, Kyotaro Horiguchi wrote:
> > Maybe I'm missing something, but I can see several instances of the
> > "eval-bool ? true : false" pattern after fd0625c7a9 that are not in
> > the latest 0002.
>
> Yep.  There are more of these, and I have just looked at some of them
> as of the patches proposed.  What was sent looked clean enough to
> progress a bit and be done with it.

While reading the decode.c I found the extra parentheses and arrived
at this thread. The discussion seems to get inactive now but one (0001
patch) out of two patches Justin proposed [1] is not committed yet and
there seems no CF entry for this item (0002 patch already got
committed, fd0625c7a9). 0001 patch can be cleanly applied and looks
good to me.

Also, regarding "x ? true: false" pattern where x is guaranteed to
yield a boolean, I found other examples other than Horiguchi-san
mentioned[2]. I've attached the patch to remove them.

Regards,

[1] https://www.postgresql.org/message-id/20210906001110.GF26465%40telsasoft.com
[2] https://www.postgresql.org/message-id/20210909.141450.11969674682374713.horikyota.ntt%40gmail.com

-- 
Masahiko Sawada
EDB:  https://www.enterprisedb.com/

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Running tests under valgrind is getting slower at an alarming pace
Следующее
От: Chris Bandy
Дата:
Сообщение: Re: Lost logs with csvlog redirected to stderr under WIN32 service