Fixed another Assert.

This commit is contained in:
negoyal 2019-09-04 10:59:44 -07:00
parent ce53f7a896
commit 91020abb5a
1 changed files with 5 additions and 3 deletions

View File

@ -524,7 +524,8 @@ public:
--r; --r;
// if the specified newOldestVersion does not exist, copy the root from next lower version to newOldestVersion position // if the specified newOldestVersion does not exist, copy the root from next lower version to newOldestVersion position
if (r->first != newOldestVersion) { if (r->first != newOldestVersion) {
r = roots.emplace(upper, *r); //r = roots.emplace(upper, *r);
r = roots.emplace(upper, newOldestVersion, getRoot(newOldestVersion));
} }
UNSTOPPABLE_ASSERT(r->first == newOldestVersion); UNSTOPPABLE_ASSERT(r->first == newOldestVersion);
@ -542,14 +543,15 @@ public:
// roots.emplace(upper_bound(roots.begin(), roots.end(), newOldestVersion, compare()), newOldestVersion, getRoot(newOldestVersion)); // roots.emplace(upper_bound(roots.begin(), roots.end(), newOldestVersion, compare()), newOldestVersion, getRoot(newOldestVersion));
//} //}
if (r->first != newOldestVersion) { if (r->first != newOldestVersion) {
r = roots.emplace(upper, *r); //r = roots.emplace(upper, *r);
r = roots.emplace(upper, newOldestVersion, getRoot(newOldestVersion));
} }
UNSTOPPABLE_ASSERT(r->first == newOldestVersion); UNSTOPPABLE_ASSERT(r->first == newOldestVersion);
vector<Tree> toFree; vector<Tree> toFree;
toFree.reserve(10000); toFree.reserve(10000);
auto newBegin = r;//lower_bound(roots.begin(), roots.end(), newOldestVersion, compare()); auto newBegin = r; //lower_bound(roots.begin(), roots.end(), newOldestVersion, compare());
Tree *lastRoot = nullptr; Tree *lastRoot = nullptr;
for(auto root = roots.begin(); root != newBegin; ++root) { for(auto root = roots.begin(); root != newBegin; ++root) {
if(root->second) { if(root->second) {