From fc45231ef05395f833f8070720b274eff7a24bf2 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Fri, 11 Aug 2023 14:56:46 -0700 Subject: [PATCH] Improving naming [skip ci] --- src/hnswinsert.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hnswinsert.c b/src/hnswinsert.c index 7c8a7ad..7d55df0 100644 --- a/src/hnswinsert.c +++ b/src/hnswinsert.c @@ -122,7 +122,7 @@ WriteNewElementPages(Relation index, HnswElement e, int m, BlockNumber insertPag Size maxSize; Size minCombinedSize; HnswElementTuple etup; - BlockNumber originalInsertPage = insertPage; + BlockNumber currentPage = insertPage; int dimensions = e->vec->dim; HnswNeighborTuple ntup; Buffer nbuf; @@ -149,7 +149,7 @@ WriteNewElementPages(Relation index, HnswElement e, int m, BlockNumber insertPag /* Find a page (or two if needed) to insert the tuples */ for (;;) { - buf = ReadBuffer(index, insertPage); + buf = ReadBuffer(index, currentPage); LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE); state = GenericXLogStart(index); @@ -157,7 +157,7 @@ WriteNewElementPages(Relation index, HnswElement e, int m, BlockNumber insertPag /* Keep track of first page where element at level 0 can fit */ if (!BlockNumberIsValid(newInsertPage) && PageGetFreeSpace(page) >= minCombinedSize) - newInsertPage = insertPage; + newInsertPage = currentPage; /* First, try the fastest path */ /* Space for both tuples on the current page */ @@ -186,9 +186,9 @@ WriteNewElementPages(Relation index, HnswElement e, int m, BlockNumber insertPag break; } - insertPage = HnswPageGetOpaque(page)->nextblkno; + currentPage = HnswPageGetOpaque(page)->nextblkno; - if (BlockNumberIsValid(insertPage)) + if (BlockNumberIsValid(currentPage)) { /* Move to next page */ GenericXLogAbort(state); @@ -277,7 +277,7 @@ WriteNewElementPages(Relation index, HnswElement e, int m, BlockNumber insertPag UnlockReleaseBuffer(nbuf); /* Update the insert page */ - if (BlockNumberIsValid(newInsertPage) && newInsertPage != originalInsertPage) + if (BlockNumberIsValid(newInsertPage) && newInsertPage != insertPage) *updatedInsertPage = newInsertPage; }