diff --git a/ConflictSet.cpp b/ConflictSet.cpp index 36821b4..34e3073 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -1365,6 +1365,10 @@ Node *erase(Node *self, NodeAllocators *allocators, ConflictSet::Impl *impl, if (toRemoveChildrenIndex != lastChildrenIndex) { parent48->children[toRemoveChildrenIndex] = parent48->children[lastChildrenIndex]; + parent48->maxOfMax[toRemoveChildrenIndex >> Node48::kMaxOfMaxShift] = + std::max(parent48->maxOfMax[toRemoveChildrenIndex >> + Node48::kMaxOfMaxShift], + parent48->children[toRemoveChildrenIndex].childMaxVersion); auto parentIndex = parent48->children[toRemoveChildrenIndex].child->parentsIndex; parent48->index[parentIndex] = toRemoveChildrenIndex;