Include mutation's version in Iterator::operator*
This commit is contained in:
@@ -821,7 +821,8 @@ VersionedMap::Iterator::operator=(Iterator &&other) noexcept {
|
||||
return *this;
|
||||
}
|
||||
|
||||
VersionedMap::Mutation VersionedMap::Iterator::operator*() const {
|
||||
VersionedMap::Iterator::VersionedMutation
|
||||
VersionedMap::Iterator::operator*() const {
|
||||
assert(impl->finger.backNode() != 0);
|
||||
assert(impl->finger.searchPathSize() != 0);
|
||||
const auto &entry = *impl->map->mm.base[impl->finger.backNode()].entry;
|
||||
@@ -832,12 +833,14 @@ VersionedMap::Mutation VersionedMap::Iterator::operator*() const {
|
||||
const auto &prevEntry =
|
||||
*prev.impl->map->mm.base[prev.impl->finger.backNode()].entry;
|
||||
return {prevEntry.getKey(), entry.getKey(), prevEntry.keyLen + 1,
|
||||
entry.keyLen, Clear};
|
||||
entry.keyLen, Clear, entry.rangeVersion};
|
||||
}
|
||||
if (entry.valLen >= 0) {
|
||||
return {entry.getKey(), entry.getVal(), entry.keyLen, entry.valLen, Set};
|
||||
return {entry.getKey(), entry.getVal(), entry.keyLen, entry.valLen, Set,
|
||||
entry.pointVersion};
|
||||
} else {
|
||||
return {entry.getKey(), nullptr, entry.keyLen, -1, Clear};
|
||||
return {entry.getKey(), nullptr, entry.keyLen, -1,
|
||||
Clear, entry.pointVersion};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1021,11 +1024,11 @@ int main() {
|
||||
for (int i = 0; i < m.param1Len; ++i) {
|
||||
printf("x%02x", m.param1[i]);
|
||||
}
|
||||
printf(" -> ");
|
||||
printf(" -> '");
|
||||
for (int i = 0; i < m.param2Len; ++i) {
|
||||
printf("x%02x", m.param2[i]);
|
||||
}
|
||||
printf("\n");
|
||||
printf("' @ %" PRId64 "\n", m.version);
|
||||
break;
|
||||
case weaselab::VersionedMap::Clear:
|
||||
printf("clear [");
|
||||
@@ -1036,7 +1039,7 @@ int main() {
|
||||
for (int i = 0; i < m.param2Len; ++i) {
|
||||
printf("x%02x", m.param2[i]);
|
||||
}
|
||||
printf(")\n");
|
||||
printf(") @ %" PRId64 "\n", m.version);
|
||||
break;
|
||||
default: // GCOVR_EXCL_LINE
|
||||
__builtin_unreachable(); // GCOVR_EXCL_LINE
|
||||
|
Reference in New Issue
Block a user