Don't initialize max version if child doesn't exist
This commit is contained in:
@@ -1147,21 +1147,27 @@ ChildAndMaxVersion getChildAndMaxVersion(Node0 *, uint8_t) { return {}; }
|
||||
ChildAndMaxVersion getChildAndMaxVersion(Node3 *self, uint8_t index) {
|
||||
int i = getNodeIndex(self, index);
|
||||
if (i < 0) {
|
||||
return {};
|
||||
ChildAndMaxVersion result;
|
||||
result.child = nullptr;
|
||||
return result;
|
||||
}
|
||||
return {self->children[i], self->childMaxVersion[i]};
|
||||
}
|
||||
ChildAndMaxVersion getChildAndMaxVersion(Node16 *self, uint8_t index) {
|
||||
int i = getNodeIndex(self, index);
|
||||
if (i < 0) {
|
||||
return {};
|
||||
ChildAndMaxVersion result;
|
||||
result.child = nullptr;
|
||||
return result;
|
||||
}
|
||||
return {self->children[i], self->childMaxVersion[i]};
|
||||
}
|
||||
ChildAndMaxVersion getChildAndMaxVersion(Node48 *self, uint8_t index) {
|
||||
int i = self->index[index];
|
||||
if (i < 0) {
|
||||
return {};
|
||||
ChildAndMaxVersion result;
|
||||
result.child = nullptr;
|
||||
return result;
|
||||
}
|
||||
return {self->children[i], self->childMaxVersion[i]};
|
||||
}
|
||||
|
Reference in New Issue
Block a user