Fix two canonicalization bugs
This commit is contained in:
@@ -961,6 +961,8 @@ struct __attribute__((__visibility__("hidden"))) VersionedMap::Impl {
|
||||
remove(iter);
|
||||
insert(keyAfter({m.param1, m.param1Len}, arena), {},
|
||||
/*endRange*/ true, iter);
|
||||
} else if (engulfRight) {
|
||||
insert({m.param1, m.param1Len}, {}, /*endRange*/ false, iter);
|
||||
} else {
|
||||
insert({m.param1, m.param1Len}, {{nullptr, -1}}, /*endRange*/ false,
|
||||
iter);
|
||||
@@ -992,12 +994,15 @@ struct __attribute__((__visibility__("hidden"))) VersionedMap::Impl {
|
||||
}
|
||||
|
||||
// Check if we can engulf on the right
|
||||
end.copyTo(copy);
|
||||
move<std::memory_order_relaxed, true>(copy, latestVersion);
|
||||
const auto *next = copy.searchPathSize() > 0
|
||||
? mm.base[copy.backNode()].entry
|
||||
: nullptr;
|
||||
const bool engulfRight = next && next->clearTo();
|
||||
bool engulfRight = false;
|
||||
if (!foundEnd) {
|
||||
end.copyTo(copy);
|
||||
move<std::memory_order_relaxed, true>(copy, latestVersion);
|
||||
const auto *next = copy.searchPathSize() > 0
|
||||
? mm.base[copy.backNode()].entry
|
||||
: nullptr;
|
||||
engulfRight = next && next->clearTo();
|
||||
}
|
||||
|
||||
if (engulfLeft && foundBegin) {
|
||||
remove(begin);
|
||||
|
Reference in New Issue
Block a user