Count implicit key byte for maybeDecreaseCapacity

This commit is contained in:
2024-03-18 11:42:53 -07:00
parent 5aab76847a
commit 8e0e65dac6

View File

@@ -1078,7 +1078,7 @@ void freeAndMakeCapacityAtLeast(Node *&self, int capacity,
void maybeDecreaseCapacity(Node *&self, NodeAllocators *allocators, void maybeDecreaseCapacity(Node *&self, NodeAllocators *allocators,
ConflictSet::Impl *impl) { ConflictSet::Impl *impl) {
const int maxCapacity = const int maxCapacity =
(self->numChildren + int(self->entryPresent)) * self->partialKeyLen; (self->numChildren + int(self->entryPresent)) * (self->partialKeyLen + 1);
if (self->getCapacity() <= maxCapacity) { if (self->getCapacity() <= maxCapacity) {
return; return;
} }