1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-09 06:21:09 +03:00

Use XLogRecPtrIsValid() in various places

Now that commit 06edbed478 has introduced XLogRecPtrIsValid(), we can
use that instead of:

- XLogRecPtrIsInvalid()
- direct comparisons with InvalidXLogRecPtr
- direct comparisons with literal 0

This makes the code more consistent.

Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Discussion: https://postgr.es/m/aQB7EvGqrbZXrMlg@ip-10-97-1-34.eu-west-3.compute.internal
This commit is contained in:
Álvaro Herrera
2025-11-06 20:33:57 +01:00
parent 06edbed478
commit a2b02293bc
46 changed files with 239 additions and 238 deletions

View File

@@ -83,7 +83,7 @@ GetCurrentLSN(void)
else
curr_lsn = GetXLogReplayRecPtr(NULL);
Assert(!XLogRecPtrIsInvalid(curr_lsn));
Assert(XLogRecPtrIsValid(curr_lsn));
return curr_lsn;
}
@@ -127,7 +127,7 @@ InitXLogReaderState(XLogRecPtr lsn)
/* first find a valid recptr to start from */
first_valid_record = XLogFindNextRecord(xlogreader, lsn);
if (XLogRecPtrIsInvalid(first_valid_record))
if (!XLogRecPtrIsValid(first_valid_record))
ereport(ERROR,
errmsg("could not find a valid record after %X/%08X",
LSN_FORMAT_ARGS(lsn)));