Only search backward for materializing clear range

This commit is contained in:
2024-06-19 12:16:09 -07:00
parent c4c269ab94
commit 39273424c1

View File

@@ -1220,6 +1220,9 @@ VersionedMap::Iterator::operator*() const {
void materializeMutations(VersionedMap::Iterator::Impl *impl,
const Entry *prev) {
const auto &entry = *impl->map->mm.base[impl->finger.backNode()].entry;
impl->mutationCount = 0;
if (entry.clearTo()) {
if (prev == nullptr) {
Finger copy;
impl->finger.copyTo(copy);
@@ -1231,9 +1234,6 @@ void materializeMutations(VersionedMap::Iterator::Impl *impl,
}
}
const auto &entry = *impl->map->mm.base[impl->finger.backNode()].entry;
impl->mutationCount = 0;
if (entry.clearTo()) {
impl->mutations[impl->mutationCount++] = {
prev->getKey(),
entry.getKey(),