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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: strange case of "if ((a & b))"
Дата
Msg-id 577206.1620628321@sss.pgh.pa.us
обсуждение исходный текст
Ответ на strange case of "if ((a & b))"  (Justin Pryzby <pryzby@telsasoft.com>)
Список pgsql-hackers
Michael Paquier <michael@paquier.xyz> writes:
> On Wed, Apr 28, 2021 at 02:40:09PM -0400, Tom Lane wrote:
>> Agreed, but shouldn't we just drop the excess parens rather than
>> doubling down on useless notation?

> Using a notation like ((a & b) != 0) to enforce a boolean check after
> the bitwise operation is the usual notation I've preferred, FWIW.  Do
> you mean something different here?

Yeah --- the "!= 0" is pointless in the context of an if-test.

            regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Inaccurate error message when set fdw batch_size to 0
Следующее
От: "tanghy.fnst@fujitsu.com"
Дата:
Сообщение: RE: Remove "FROM" in "DELETE FROM" when using tab-completion