Unnest some in checkPointRead

This commit is contained in:
2024-02-22 15:43:13 -08:00
parent c16feda9f8
commit 3c93b9a3ce

View File

@@ -808,21 +808,22 @@ bool checkPointRead(Node *n, const std::span<const uint8_t> key,
assert(c >= 0); assert(c >= 0);
n = getChildExists(n, c); n = getChildExists(n, c);
goto downLeftSpine; goto downLeftSpine;
} else { }
int c = getChildGeq(n, remaining[0]);
if (c == remaining[0]) { int c = getChildGeq(n, remaining[0]);
if (c != remaining[0]) {
if (c >= 0) {
n = getChildExists(n, c); n = getChildExists(n, c);
remaining = remaining.subspan(1, remaining.size() - 1); goto downLeftSpine;
} else { } else {
if (c >= 0) { n = nextSibling(n);
n = getChildExists(n, c); goto downLeftSpine;
goto downLeftSpine;
} else {
n = nextSibling(n);
goto downLeftSpine;
}
} }
} }
n = getChildExists(n, c);
remaining = remaining.subspan(1, remaining.size() - 1);
if (n->partialKeyLen > 0) { if (n->partialKeyLen > 0) {
int commonLen = std::min<int>(n->partialKeyLen, remaining.size()); int commonLen = std::min<int>(n->partialKeyLen, remaining.size());
int i = longestCommonPrefix(n->partialKey, remaining.data(), commonLen); int i = longestCommonPrefix(n->partialKey, remaining.data(), commonLen);