mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +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:
@@ -682,7 +682,7 @@ gistdoinsert(Relation r, IndexTuple itup, Size freespace,
|
||||
state.stack = stack = stack->parent;
|
||||
}
|
||||
|
||||
if (XLogRecPtrIsInvalid(stack->lsn))
|
||||
if (!XLogRecPtrIsValid(stack->lsn))
|
||||
stack->buffer = ReadBuffer(state.r, stack->blkno);
|
||||
|
||||
/*
|
||||
@@ -698,7 +698,7 @@ gistdoinsert(Relation r, IndexTuple itup, Size freespace,
|
||||
stack->page = BufferGetPage(stack->buffer);
|
||||
stack->lsn = xlocked ?
|
||||
PageGetLSN(stack->page) : BufferGetLSNAtomic(stack->buffer);
|
||||
Assert(!RelationNeedsWAL(state.r) || !XLogRecPtrIsInvalid(stack->lsn));
|
||||
Assert(!RelationNeedsWAL(state.r) || XLogRecPtrIsValid(stack->lsn));
|
||||
|
||||
/*
|
||||
* If this page was split but the downlink was never inserted to the
|
||||
|
||||
Reference in New Issue
Block a user