Re: Propose a new function - list_is_empty

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Propose a new function - list_is_empty
Дата
Msg-id 1116757.1660657071@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Propose a new function - list_is_empty  (Daniel Gustafsson <daniel@yesql.se>)
Список pgsql-hackers
Daniel Gustafsson <daniel@yesql.se> writes:
> I think these are nice cleanups to simplify and streamline the code, just a few
> small comments from reading the patch:

>      /* If no subcommands, don't collect */
> -    if (list_length(currentEventTriggerState->currentCommand->d.alterTable.subcmds) != 0)
> +    if (currentEventTriggerState->currentCommand->d.alterTable.subcmds)
> Here the current coding gives context about the data structure used for the
> subcmds member which is now lost.  I don't mind the change but rewording the
> comment above to indicate that subcmds is a list would be good IMHO.

I think testing for equality to NIL is better where that's a concern.

> Might be personal taste, but I think the parenthesis should be kept here as a
> visual aid for the reader.

+1

            regards, tom lane



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

Предыдущее
От: "Drouvot, Bertrand"
Дата:
Сообщение: Re: shared-memory based stats collector - v70
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Propose a new function - list_is_empty