diff options
| author | Alexander Korotkov <akorotkov@postgresql.org> | 2025-12-14 17:18:32 +0200 |
|---|---|---|
| committer | Alexander Korotkov <akorotkov@postgresql.org> | 2025-12-14 17:18:32 +0200 |
| commit | b27e48213fbc1d0ff698be4ae5a0eb3e161d9172 (patch) | |
| tree | 488723c71472770d681a82c77d44f3dd8511ac3e /src/backend/access | |
| parent | c5ae07a90a0f3594e5053a26f3c99b041df427d3 (diff) | |
Refactor WaitLSNType enum to use a macro for type count
Change WAIT_LSN_TYPE_COUNT from an enum sentinel to a macro definition,
in a similar way to IOObject, IOContext, and BackendType enums. Remove
explicit enum value assignments well.
Author: Xuneng Zhou <xunengzhou@gmail.com>
Diffstat (limited to 'src/backend/access')
| -rw-r--r-- | src/backend/access/transam/xlogwait.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/access/transam/xlogwait.c b/src/backend/access/transam/xlogwait.c index 84613fc39c7..6109381c0f0 100644 --- a/src/backend/access/transam/xlogwait.c +++ b/src/backend/access/transam/xlogwait.c @@ -126,7 +126,7 @@ updateMinWaitedLSN(WaitLSNType lsnType) XLogRecPtr minWaitedLSN = PG_UINT64_MAX; int i = (int) lsnType; - Assert(i >= 0 && i < (int) WAIT_LSN_TYPE_COUNT); + Assert(i >= 0 && i < WAIT_LSN_TYPE_COUNT); if (!pairingheap_is_empty(&waitLSNState->waitersHeap[i])) { @@ -147,7 +147,7 @@ addLSNWaiter(XLogRecPtr lsn, WaitLSNType lsnType) WaitLSNProcInfo *procInfo = &waitLSNState->procInfos[MyProcNumber]; int i = (int) lsnType; - Assert(i >= 0 && i < (int) WAIT_LSN_TYPE_COUNT); + Assert(i >= 0 && i < WAIT_LSN_TYPE_COUNT); LWLockAcquire(WaitLSNLock, LW_EXCLUSIVE); @@ -172,7 +172,7 @@ deleteLSNWaiter(WaitLSNType lsnType) WaitLSNProcInfo *procInfo = &waitLSNState->procInfos[MyProcNumber]; int i = (int) lsnType; - Assert(i >= 0 && i < (int) WAIT_LSN_TYPE_COUNT); + Assert(i >= 0 && i < WAIT_LSN_TYPE_COUNT); LWLockAcquire(WaitLSNLock, LW_EXCLUSIVE); @@ -213,7 +213,7 @@ wakeupWaiters(WaitLSNType lsnType, XLogRecPtr currentLSN) int numWakeUpProcs; int i = (int) lsnType; - Assert(i >= 0 && i < (int) WAIT_LSN_TYPE_COUNT); + Assert(i >= 0 && i < WAIT_LSN_TYPE_COUNT); do { @@ -270,7 +270,7 @@ WaitLSNWakeup(WaitLSNType lsnType, XLogRecPtr currentLSN) { int i = (int) lsnType; - Assert(i >= 0 && i < (int) WAIT_LSN_TYPE_COUNT); + Assert(i >= 0 && i < WAIT_LSN_TYPE_COUNT); /* * Fast path check. Skip if currentLSN is InvalidXLogRecPtr, which means |
