Remove duplicate code
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user