diff --git a/ConflictSet.cpp b/ConflictSet.cpp index 4edae24..5735b89 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -1851,11 +1851,11 @@ struct __attribute__((visibility("hidden"))) ConflictSet::Impl { auto begin = std::span(w.begin.p, w.begin.len); auto end = std::span(w.end.p, w.end.len); if (w.end.len > 0) { - keyUpdates += 2; + keyUpdates += 3; addWriteRange(root, oldestVersion, begin, end, w.writeVersion, &allocators, this); } else { - keyUpdates += 1; + keyUpdates += 2; addPointWrite(root, oldestVersion, begin, w.writeVersion, &allocators, this); } @@ -1870,7 +1870,7 @@ struct __attribute__((visibility("hidden"))) ConflictSet::Impl { Node *prev = firstGeq(root, removalKey).n; // There's no way to erase removalKey without introducing a key after it assert(prev != nullptr); - while (keyUpdates-- > 0) { + for (; keyUpdates > 0; --keyUpdates) { Node *n = nextLogical(prev); if (n == nullptr) { removalKey = {};