Return tagged pointer from getChildAndMaxVersion

This commit is contained in:
2024-10-10 10:21:33 -07:00
parent 7abb129f03
commit b9c642d81d

View File

@@ -1137,7 +1137,7 @@ Node *getChild(Node *self, uint8_t index) {
}
struct ChildAndMaxVersion {
Node *child;
TaggedNodePointer child;
InternalVersionT maxVersion;
};
@@ -1980,7 +1980,8 @@ bool checkPointRead(Node *n, const std::span<const uint8_t> key,
goto downLeftSpine;
}
auto [child, maxV] = getChildAndMaxVersion(n, remaining[0]);
auto [c, maxV] = getChildAndMaxVersion(n, remaining[0]);
Node *child = c;
if (child == nullptr) {
auto c = getChildGeq(n, remaining[0]);
if (c != nullptr) {
@@ -2050,7 +2051,8 @@ bool checkPrefixRead(Node *n, const std::span<const uint8_t> key,
return maxVersion(n) <= readVersion;
}
auto [child, maxV] = getChildAndMaxVersion(n, remaining[0]);
auto [c, maxV] = getChildAndMaxVersion(n, remaining[0]);
Node *child = c;
if (child == nullptr) {
auto c = getChildGeq(n, remaining[0]);
if (c != nullptr) {
@@ -2649,7 +2651,8 @@ bool checkRangeLeftSide(Node *n, std::span<const uint8_t> key, int prefixLen,
}
}
auto [child, maxV] = getChildAndMaxVersion(n, remaining[0]);
auto [c, maxV] = getChildAndMaxVersion(n, remaining[0]);
Node *child = c;
if (child == nullptr) {
auto c = getChildGeq(n, remaining[0]);
if (c != nullptr) {
@@ -2837,7 +2840,8 @@ bool checkRangeRead(Node *n, std::span<const uint8_t> begin,
if (remaining.size() == 0) {
break;
}
auto [child, v] = getChildAndMaxVersion(n, remaining[0]);
auto [c, v] = getChildAndMaxVersion(n, remaining[0]);
Node *child = c;
if (child == nullptr) {
break;
}