From a5b35fcedb542587e7d8b8fcd21a2e0995b82d2f Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 24 Sep 2025 15:14:06 +0200 Subject: Remove PointerIsValid() This doesn't provide any value over the standard style of checking the pointer directly or comparing against NULL. Also remove related: - AllocPointerIsValid() [unused] - IndexScanIsValid() [had one user] - HeapScanIsValid() [unused] - InvalidRelation [unused] Leaving HeapTupleIsValid(), ItemIdIsValid(), PortalIsValid(), RelationIsValid for now, to reduce code churn. Reviewed-by: Jacob Champion Discussion: https://www.postgresql.org/message-id/flat/ad50ab6b-6f74-4603-b099-1cd6382fb13d%40eisentraut.org Discussion: https://www.postgresql.org/message-id/CA+hUKG+NFKnr=K4oybwDvT35dW=VAjAAfiuLxp+5JeZSOV3nBg@mail.gmail.com Discussion: https://www.postgresql.org/message-id/bccf2803-5252-47c2-9ff0-340502d5bd1c@iki.fi --- src/backend/access/common/reloptions.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/backend/access/common/reloptions.c') diff --git a/src/backend/access/common/reloptions.c b/src/backend/access/common/reloptions.c index 0af3fea68fa..35150bf237b 100644 --- a/src/backend/access/common/reloptions.c +++ b/src/backend/access/common/reloptions.c @@ -1179,7 +1179,7 @@ transformRelOptions(Datum oldOptions, List *defList, const char *nameSpace, astate = NULL; /* Copy any oldOptions that aren't to be replaced */ - if (PointerIsValid(DatumGetPointer(oldOptions))) + if (DatumGetPointer(oldOptions) != NULL) { ArrayType *array = DatumGetArrayTypeP(oldOptions); Datum *oldoptions; @@ -1357,7 +1357,7 @@ untransformRelOptions(Datum options) int i; /* Nothing to do if no options */ - if (!PointerIsValid(DatumGetPointer(options))) + if (DatumGetPointer(options) == NULL) return result; array = DatumGetArrayTypeP(options); @@ -1549,7 +1549,7 @@ parseRelOptions(Datum options, bool validate, relopt_kind kind, } /* Done if no options */ - if (PointerIsValid(DatumGetPointer(options))) + if (DatumGetPointer(options) != NULL) parseRelOptionsInternal(options, validate, reloptions, numoptions); *numrelopts = numoptions; @@ -2092,7 +2092,7 @@ index_reloptions(amoptions_function amoptions, Datum reloptions, bool validate) Assert(amoptions != NULL); /* Assume function is strict */ - if (!PointerIsValid(DatumGetPointer(reloptions))) + if (DatumGetPointer(reloptions) == NULL) return NULL; return amoptions(reloptions, validate); -- cgit v1.2.3