mirror of
https://github.com/postgres/postgres.git
synced 2025-11-18 02:02:55 +03:00
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 <jacob.champion@enterprisedb.com> 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
This commit is contained in:
4
src/backend/utils/cache/relcache.c
vendored
4
src/backend/utils/cache/relcache.c
vendored
@@ -2896,7 +2896,7 @@ RelationForgetRelation(Oid rid)
|
||||
|
||||
RelationIdCacheLookup(rid, relation);
|
||||
|
||||
if (!PointerIsValid(relation))
|
||||
if (!relation)
|
||||
return; /* not in cache, nothing to do */
|
||||
|
||||
if (!RelationHasReferenceCountZero(relation))
|
||||
@@ -2941,7 +2941,7 @@ RelationCacheInvalidateEntry(Oid relationId)
|
||||
|
||||
RelationIdCacheLookup(relationId, relation);
|
||||
|
||||
if (PointerIsValid(relation))
|
||||
if (relation)
|
||||
{
|
||||
relcacheInvalsReceived++;
|
||||
RelationFlushRelation(relation);
|
||||
|
||||
Reference in New Issue
Block a user