@@ -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
16021600end :
16031601 entry -> curRumKey = entry -> list [entry -> offset ];
1602+ entry -> offset += entry -> scanDirection ;
16041603 return true;
16051604}
16061605
0 commit comments