Save some bounds checking for scanning Node256

This commit is contained in:
2024-06-26 20:55:18 -07:00
parent fa86d3e707
commit 02866a8cae

View File

@@ -1762,10 +1762,9 @@ bool checkMaxBetweenExclusive(Node *n, int begin, int end,
}
// Check inner pages
bool result = true;
for (int i = 1; i < Node256::kMaxOfMaxTotalPages - 1; ++i) {
result &= !((self->maxOfMax[i] > readVersion) &
((begin >> Node256::kMaxOfMaxShift) + 1 <= i) &
(i < ((end - 1) >> Node256::kMaxOfMaxShift)));
for (int i = (begin >> Node256::kMaxOfMaxShift) + 1;
i < ((end - 1) >> Node256::kMaxOfMaxShift); ++i) {
result &= self->maxOfMax[i] <= readVersion;
}
return result;
}