Prepare to skip right of c in "left side of pyramid"
This commit is contained in:
@@ -994,11 +994,6 @@ bool checkRangeRead(Node *n, const std::span<const uint8_t> begin,
|
|||||||
assert(left.n == iter.n);
|
assert(left.n == iter.n);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if DEBUG_VERBOSE && !defined(NDEBUG)
|
|
||||||
fprintf(stderr, "firstGeq for `%s' got `%s'\n", printable(begin).c_str(),
|
|
||||||
getSearchPathPrintable(left.n).c_str());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (left.n == nullptr) {
|
if (left.n == nullptr) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1025,6 +1020,10 @@ bool checkRangeRead(Node *n, const std::span<const uint8_t> begin,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if DEBUG_VERBOSE && !defined(NDEBUG)
|
||||||
|
fprintf(stderr, "Visit %s\n", printable(searchPath).c_str());
|
||||||
|
#endif
|
||||||
|
|
||||||
if (iter->entryPresent) {
|
if (iter->entryPresent) {
|
||||||
if (!first && iter->entry.rangeVersion > readVersion) {
|
if (!first && iter->entry.rangeVersion > readVersion) {
|
||||||
return false;
|
return false;
|
||||||
@@ -1035,10 +1034,6 @@ bool checkRangeRead(Node *n, const std::span<const uint8_t> begin,
|
|||||||
}
|
}
|
||||||
|
|
||||||
assert(searchPath == getSearchPath(arena, iter));
|
assert(searchPath == getSearchPath(arena, iter));
|
||||||
#if DEBUG_VERBOSE && !defined(NDEBUG)
|
|
||||||
fprintf(stderr, "Max version of keys starting with %s: %" PRId64 "\n",
|
|
||||||
printable(searchPath).c_str(), iter->maxVersion);
|
|
||||||
#endif
|
|
||||||
if (lcp == depth) {
|
if (lcp == depth) {
|
||||||
// end starts with searchPath, so end < range
|
// end starts with searchPath, so end < range
|
||||||
if (iter->maxVersion <= readVersion) {
|
if (iter->maxVersion <= readVersion) {
|
||||||
@@ -1080,6 +1075,18 @@ bool checkRangeRead(Node *n, const std::span<const uint8_t> begin,
|
|||||||
} else {
|
} else {
|
||||||
ascend(depth, lcp, iter, searchPath);
|
ascend(depth, lcp, iter, searchPath);
|
||||||
iter = iter->parent;
|
iter = iter->parent;
|
||||||
|
if (depth - iter->partialKeyLen - lcp > 1) {
|
||||||
|
#if DEBUG_VERBOSE && !defined(NDEBUG)
|
||||||
|
fprintf(stderr, "%s, right of %02x\n",
|
||||||
|
printable(searchPath).c_str(), next);
|
||||||
|
#endif
|
||||||
|
while (next >= 0) {
|
||||||
|
if (getChildExists(iter, next)->maxVersion > readVersion) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
next = getChildGeq(iter, next + 1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
iter = getChildExists(iter, next);
|
iter = getChildExists(iter, next);
|
||||||
descend(depth, lcp, iter, end, searchPath);
|
descend(depth, lcp, iter, end, searchPath);
|
||||||
break;
|
break;
|
||||||
@@ -1087,6 +1094,7 @@ bool checkRangeRead(Node *n, const std::span<const uint8_t> begin,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user