Re: Remove PointerIsValid() - Mailing list pgsql-hackers

From David Rowley
Subject Re: Remove PointerIsValid()
Date
Msg-id CAApHDvqi-SGNAHJxYpe7gPz_bZx5_qkB4MJxJTKVhHT6forO2A@mail.gmail.com
Whole thread Raw
In response to Re: Remove PointerIsValid()  (Robert Haas <robertmhaas@gmail.com>)
List 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 by date:

Previous
From: Dmitry Mityugov
Date:
Subject: Re: --with-llvm on 32-bit platforms?
Next
From: David Rowley
Date:
Subject: Re: REPACK and naming