Remove duplicate code

This commit is contained in:
2024-02-09 15:32:06 -08:00
parent d1ee3d8b69
commit 593657c9aa

View File

@@ -485,21 +485,6 @@ Node *nextPhysical(Node *node) {
}
}
Node *nextPhysicalSkipSubtree(Node *node) {
int index = -1;
for (;;) {
index = node->parentsIndex;
node = node->parent;
if (node == nullptr) {
return nullptr;
}
auto nextChild = getChildGeq(node, index + 1);
if (nextChild >= 0) {
return getChildExists(node, nextChild);
}
}
}
Node *nextLogical(Node *node) {
for (node = nextPhysical(node); node != nullptr && !node->entryPresent;
node = nextPhysical(node))
@@ -792,7 +777,8 @@ bool checkRangeRead(Node *n, const std::span<const uint8_t> begin,
if (iter->maxVersion > readVersion) {
return false;
}
iter = nextPhysicalSkipSubtree(iter);
// Skip subtree
iter = nextSibling(iter);
} else {
if (onRightPath && iter->maxVersion <= readVersion) {
return true;