diff --git a/ConflictSet.cpp b/ConflictSet.cpp index 88ff72c..02b2202 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -2033,12 +2033,7 @@ struct __attribute__((visibility("hidden"))) ConflictSet::Impl { if (n == root) { n = nextLogical(n); } - for (; keyUpdates > 0; --keyUpdates) { - if (n == nullptr) { - removalKey = {}; - return; - } - + for (; keyUpdates > 0 && n != nullptr; --keyUpdates) { if (std::max(n->entry.pointVersion, n->entry.rangeVersion) <= oldestVersion) { // Any transaction n would have prevented from committing is @@ -2052,6 +2047,10 @@ struct __attribute__((visibility("hidden"))) ConflictSet::Impl { n = nextLogical(n); } } + if (n == nullptr) { + removalKey = {}; + return; + } removalKeyArena = Arena(); removalKey = getSearchPath(removalKeyArena, n); }