Simplify more "down left spine" loops
This commit is contained in:
@@ -2513,15 +2513,10 @@ bool checkRangeStartsWith(Node *n, std::span<const uint8_t> key, int begin,
|
||||
__builtin_unreachable(); // GCOVR_EXCL_LINE
|
||||
|
||||
downLeftSpine:
|
||||
for (;;) {
|
||||
if (n->entryPresent) {
|
||||
for (; !n->entryPresent; n = getFirstChildExists(n)) {
|
||||
}
|
||||
return n->entry.rangeVersion <= readVersion;
|
||||
}
|
||||
int c = getChildGeq(n, 0);
|
||||
assert(c >= 0);
|
||||
n = getChildExists(n, c);
|
||||
}
|
||||
}
|
||||
|
||||
namespace {
|
||||
// Return true if the max version among all keys that start with key[:prefixLen]
|
||||
@@ -2633,16 +2628,11 @@ template <bool kAVX512> struct CheckRangeLeftSide {
|
||||
}
|
||||
|
||||
bool downLeftSpine() {
|
||||
for (;;) {
|
||||
if (n->entryPresent) {
|
||||
for (; !n->entryPresent; n = getFirstChildExists(n)) {
|
||||
}
|
||||
ok = n->entry.rangeVersion <= readVersion;
|
||||
return true;
|
||||
}
|
||||
int c = getChildGeq(n, 0);
|
||||
assert(c >= 0);
|
||||
n = getChildExists(n, c);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Return true if the max version among all keys that start with key[:prefixLen]
|
||||
@@ -2770,16 +2760,11 @@ template <bool kAVX512> struct CheckRangeRightSide {
|
||||
}
|
||||
|
||||
bool downLeftSpine() {
|
||||
for (;;) {
|
||||
if (n->entryPresent) {
|
||||
for (; !n->entryPresent; n = getFirstChildExists(n)) {
|
||||
}
|
||||
ok = n->entry.rangeVersion <= readVersion;
|
||||
return true;
|
||||
}
|
||||
int c = getChildGeq(n, 0);
|
||||
assert(c >= 0);
|
||||
n = getChildExists(n, c);
|
||||
}
|
||||
}
|
||||
};
|
||||
} // namespace
|
||||
|
||||
|
Reference in New Issue
Block a user