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) {
|
Node *nextLogical(Node *node) {
|
||||||
for (node = nextPhysical(node); node != nullptr && !node->entryPresent;
|
for (node = nextPhysical(node); node != nullptr && !node->entryPresent;
|
||||||
node = nextPhysical(node))
|
node = nextPhysical(node))
|
||||||
@@ -792,7 +777,8 @@ bool checkRangeRead(Node *n, const std::span<const uint8_t> begin,
|
|||||||
if (iter->maxVersion > readVersion) {
|
if (iter->maxVersion > readVersion) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
iter = nextPhysicalSkipSubtree(iter);
|
// Skip subtree
|
||||||
|
iter = nextSibling(iter);
|
||||||
} else {
|
} else {
|
||||||
if (onRightPath && iter->maxVersion <= readVersion) {
|
if (onRightPath && iter->maxVersion <= readVersion) {
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user