Add a missing assert, call to removeNode

This commit is contained in:
2024-08-13 16:37:49 -07:00
parent b911d87d55
commit 43f6126cc4

View File

@@ -1636,6 +1636,7 @@ void maybeDownsize(Node *self, WriteContext *tls, ConflictSet::Impl *impl,
case Type_Node3: {
auto *self3 = (Node3 *)self;
if (self->numChildren == 0) {
assert(self->entryPresent);
auto *newSelf = tls->allocate<Node0>(self->partialKeyLen);
newSelf->copyChildrenAndKeyFrom(*self3);
getInTree(self, impl) = newSelf;
@@ -1755,6 +1756,7 @@ void destroyTree(Node *root, int64_t *entriesErased) {
default: // GCOVR_EXCL_LINE
__builtin_unreachable(); // GCOVR_EXCL_LINE
}
removeNode(n);
safe_free(n, n->size());
}
}