Skip to content

Commit b18c2de

Browse files
committed
Rearrange some static assertions for consistency
Put lengthof first. Reported-by: Peter Smith <smithpb2250@gmail.com> Discussion: https://www.postgresql.org/message-id/CAHut+PsUDMySVRuRc=h+P5N3+=TGvj4W_mi32XXg9dt4o-BXbA@mail.gmail.com
1 parent 6fcda9a commit b18c2de

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/backend/executor/execExprInterp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull)
496496
&&CASE_EEOP_LAST
497497
};
498498

499-
StaticAssertStmt(EEOP_LAST + 1 == lengthof(dispatch_table),
499+
StaticAssertStmt(lengthof(dispatch_table) == EEOP_LAST + 1,
500500
"dispatch_table out of whack with ExprEvalOp");
501501

502502
if (unlikely(state == NULL))

src/backend/utils/cache/syscache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ InitCatalogCache(void)
10681068
{
10691069
int cacheId;
10701070

1071-
StaticAssertStmt(SysCacheSize == (int) lengthof(cacheinfo),
1071+
StaticAssertStmt(lengthof(cacheinfo) == SysCacheSize,
10721072
"SysCacheSize does not match syscache.c's array");
10731073

10741074
Assert(!CacheInitialized);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy