Add Entry::pointClear
This commit is contained in:
@@ -91,6 +91,7 @@ struct Entry {
|
|||||||
// True if the entry is a point mutation. If false, this entry's key should be
|
// True if the entry is a point mutation. If false, this entry's key should be
|
||||||
// read through to the underlying data structure.
|
// read through to the underlying data structure.
|
||||||
bool pointMutation() const { return pointVersion >= 0; }
|
bool pointMutation() const { return pointVersion >= 0; }
|
||||||
|
bool pointClear() const { return pointVersion >= 0 && valLen < 0; }
|
||||||
|
|
||||||
// True if mutations in (pred, this) are cleared. If false, (pred, this)
|
// True if mutations in (pred, this) are cleared. If false, (pred, this)
|
||||||
// should be read through to the underlying data structure.
|
// should be read through to the underlying data structure.
|
||||||
@@ -1065,8 +1066,7 @@ void materializeMutations(VersionedMap::Iterator::Impl *impl, const Entry *prev,
|
|||||||
impl->mutations[impl->mutationCount++] = {
|
impl->mutations[impl->mutationCount++] = {
|
||||||
prev->getKey(),
|
prev->getKey(),
|
||||||
entry.getKey(),
|
entry.getKey(),
|
||||||
prev->pointMutation() && prev->valLen < 0 &&
|
prev->pointClear() && prev->pointVersion == entry.rangeVersion
|
||||||
prev->pointVersion == entry.rangeVersion
|
|
||||||
? prev->keyLen
|
? prev->keyLen
|
||||||
: prev->keyLen + 1,
|
: prev->keyLen + 1,
|
||||||
entry.keyLen,
|
entry.keyLen,
|
||||||
@@ -1074,7 +1074,7 @@ void materializeMutations(VersionedMap::Iterator::Impl *impl, const Entry *prev,
|
|||||||
entry.rangeVersion};
|
entry.rangeVersion};
|
||||||
}
|
}
|
||||||
if (entry.pointMutation()) {
|
if (entry.pointMutation()) {
|
||||||
if (entry.valLen < 0) {
|
if (entry.valLen < 0 /* pointClear */) {
|
||||||
if (next == nullptr ||
|
if (next == nullptr ||
|
||||||
!(next->clearTo() && next->rangeVersion == entry.pointVersion)) {
|
!(next->clearTo() && next->rangeVersion == entry.pointVersion)) {
|
||||||
impl->mutations[impl->mutationCount++] = {
|
impl->mutations[impl->mutationCount++] = {
|
||||||
|
Reference in New Issue
Block a user