Re: Propose a new function - list_is_empty

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Propose a new function - list_is_empty
Дата
Msg-id 1754766.1660744099@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Propose a new function - list_is_empty  (Junwang Zhao <zhjwpku@gmail.com>)
Ответы Re: Propose a new function - list_is_empty  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Junwang Zhao <zhjwpku@gmail.com> writes:
> There are some places that add extra parenthesis like here
>   while (list_length(sortclause) > list_length(previous) &&
> -        list_length(new_elems) > 0)
> +        (new_elems != NIL))

> Is it necessary to add that extra parenthesis?

I'd drop the parens in these particular examples because they are
inconsistent with the other parts of the same "if" condition.
I concur with Daniel's point that parens can be useful as a visual
aid even when they aren't strictly necessary --- but I don't think
we should make future readers wonder why one half of the "if"
is parenthesized and the other isn't.

            regards, tom lane



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

Предыдущее
От: Andrey Borodin
Дата:
Сообщение: Re: Amcheck verification of GiST and GIN
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: [RFC] building postgres with meson - v11