Re: Remove PointerIsValid()

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Remove PointerIsValid()
Дата
Msg-id CA+TgmoaRMgsO3WonpJt2dsGB+R04x8QhdQWBPdXvv8bnrce59w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Remove PointerIsValid()  (Chao Li <li.evan.chao@gmail.com>)
Ответы Re: Remove PointerIsValid()
Re: Remove PointerIsValid()
Список pgsql-hackers
On Wed, Sep 17, 2025 at 4:12 AM Chao Li <li.evan.chao@gmail.com> wrote:
> Given the context of replacing PointerIsValid(x), I think if (foo != NULL) is slightly better than if (x), because
thatexplicitly shows the intent of checking pointers, while if (x) works for both pointers and integers. 

I agree that we should prefer foo != NULL, but if the surrounding code
in a particular location just tests if (foo), then it may be better in
that case to go that route.

--
Robert Haas
EDB: http://www.enterprisedb.com



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