On Wed, Sep 17, 2025 at 4:12 AM Chao Li <[email protected]> wrote:
> Given the context of replacing PointerIsValid(x), I think if (foo != NULL) is 
> slightly better than if (x), because that explicitly 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


Reply via email to