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
This commit is contained in:
Peter Eisentraut 2022-12-14 16:08:13 +01:00
parent 6fcda9aba8
commit b18c2decd7
2 changed files with 2 additions and 2 deletions

View File

@ -496,7 +496,7 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull)
&&CASE_EEOP_LAST
};
StaticAssertStmt(EEOP_LAST + 1 == lengthof(dispatch_table),
StaticAssertStmt(lengthof(dispatch_table) == EEOP_LAST + 1,
"dispatch_table out of whack with ExprEvalOp");
if (unlikely(state == NULL))

View File

@ -1068,7 +1068,7 @@ InitCatalogCache(void)
{
int cacheId;
StaticAssertStmt(SysCacheSize == (int) lengthof(cacheinfo),
StaticAssertStmt(lengthof(cacheinfo) == SysCacheSize,
"SysCacheSize does not match syscache.c's array");
Assert(!CacheInitialized);