mirror of
https://github.com/loro-dev/loro.git
synced 2024-11-24 12:20:06 +00:00
fix: better tree cache current vv
This commit is contained in:
parent
75e14dea6b
commit
b775bc7a9e
1 changed files with 3 additions and 9 deletions
|
@ -232,6 +232,7 @@ impl TreeDiffCalculator {
|
|||
};
|
||||
tree_cache.apply(op);
|
||||
}
|
||||
tree_cache.current_vv = to.clone();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -324,7 +325,7 @@ impl TreeDiffCalculator {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
tree_cache.current_vv = lca_vv;
|
||||
// forward
|
||||
tracing::info!("forward");
|
||||
let group = h
|
||||
|
@ -391,6 +392,7 @@ impl TreeDiffCalculator {
|
|||
}
|
||||
}
|
||||
}
|
||||
tree_cache.current_vv = to.clone();
|
||||
TreeDelta { diff: diffs }
|
||||
})
|
||||
}
|
||||
|
@ -476,14 +478,6 @@ impl TreeCacheForDiff {
|
|||
op.id.counter,
|
||||
op.id.counter + 1,
|
||||
));
|
||||
// Only shrink cannot get the correct empty vv,
|
||||
if self.is_empty() {
|
||||
self.current_vv = VersionVector::default();
|
||||
}
|
||||
}
|
||||
|
||||
fn is_empty(&self) -> bool {
|
||||
self.tree.iter().all(|(_, v)| v.is_empty())
|
||||
}
|
||||
|
||||
fn is_ancestor_of(&self, maybe_ancestor: &TreeID, node_id: &TreeParentId) -> bool {
|
||||
|
|
Loading…
Reference in a new issue