Re: Remove PointerIsValid()

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Remove PointerIsValid()
Дата
Msg-id CAApHDvqi-SGNAHJxYpe7gPz_bZx5_qkB4MJxJTKVhHT6forO2A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Remove PointerIsValid()  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Thu, 18 Sept 2025 at 03:55, Robert Haas <robertmhaas@gmail.com> wrote:
> 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.

+1. I generally do (var != NULL) for pointers rather than (var). I
think it makes the code easier to read as a reader instantly knows
"var" is a pointer and not an int or bool.

Also, agree that we can relax that a little when all the surrounding
code does (var)

David



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