Skip to content

Commit 26a9438

Browse files
author
Artur Zakirov
committed
Issue #13. Fix forgot offset increments.
1 parent 85a4291 commit 26a9438

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/rumget.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -833,11 +833,8 @@ entryGetNextItem(RumState * rumstate, RumScanEntry entry)
833833
* It's needed to go by right link. During that we should refind
834834
* first ItemPointer greater that stored
835835
*/
836-
if ((ScanDirectionIsForward(entry->scanDirection) && RumPageRightMost(page))
837-
||
836+
if ((ScanDirectionIsForward(entry->scanDirection) && RumPageRightMost(page)) ||
838837
(ScanDirectionIsBackward(entry->scanDirection) && RumPageLeftMost(page)))
839-
840-
841838
{
842839
UnlockReleaseBuffer(entry->buffer);
843840
ItemPointerSetInvalid(&entry->curRumKey.iptr);
@@ -895,6 +892,7 @@ entryGetNextItem(RumState * rumstate, RumScanEntry entry)
895892
}
896893

897894
entry->curRumKey = entry->list[entry->offset];
895+
entry->offset += entry->scanDirection;
898896
return;
899897
}
900898
}
@@ -1039,8 +1037,8 @@ entryGetNextItemList(RumState * rumstate, RumScanEntry entry)
10391037

10401038
Assert(entry->nlist > 0);
10411039

1042-
entry->offset++;
1043-
entry->curRumKey = entry->list[entry->offset - 1];
1040+
entry->curRumKey = entry->list[entry->offset];
1041+
entry->offset += entry->scanDirection;
10441042

10451043
/*
10461044
* Done with this entry, go to the next for the future.
@@ -1601,6 +1599,7 @@ scanPage(RumState * rumstate, RumScanEntry entry, RumKey *item,
16011599

16021600
end:
16031601
entry->curRumKey = entry->list[entry->offset];
1602+
entry->offset += entry->scanDirection;
16041603
return true;
16051604
}
16061605

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy