mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-24 12:48:55 +00:00
tree_builder: remove unnecessary has_overrides()
method
It's easy to instead check if the new tree id is different from the tree id.
This commit is contained in:
parent
598cfcb89b
commit
2fe4372121
2 changed files with 3 additions and 6 deletions
|
@ -50,10 +50,6 @@ impl TreeBuilder {
|
|||
self.store.as_ref()
|
||||
}
|
||||
|
||||
pub fn has_overrides(&self) -> bool {
|
||||
!self.overrides.is_empty()
|
||||
}
|
||||
|
||||
pub fn set(&mut self, path: RepoPath, value: TreeValue) {
|
||||
assert!(!path.is_root());
|
||||
self.overrides.insert(path, Override::Replace(value));
|
||||
|
|
|
@ -717,8 +717,9 @@ impl TreeState {
|
|||
}
|
||||
});
|
||||
trace_span!("write tree").in_scope(|| {
|
||||
is_dirty |= tree_builder.has_overrides();
|
||||
self.tree_id = tree_builder.write_tree();
|
||||
let new_tree_id = tree_builder.write_tree();
|
||||
is_dirty |= new_tree_id != self.tree_id;
|
||||
self.tree_id = new_tree_id;
|
||||
});
|
||||
if cfg!(debug_assertions) {
|
||||
let tree = self.current_tree().unwrap();
|
||||
|
|
Loading…
Reference in a new issue