forked from mirrors/jj
repo: micro-optimize add_head() to not instantiate indexed commit object
This commit is contained in:
parent
15fb8b95b0
commit
72271c0d1f
1 changed files with 4 additions and 3 deletions
|
@ -935,9 +935,10 @@ impl MutableRepo {
|
|||
|commit: &Commit| commit.id().clone(),
|
||||
|commit: &Commit| -> Vec<Commit> {
|
||||
commit
|
||||
.parents()
|
||||
.into_iter()
|
||||
.filter(|parent| !self.index().has_id(parent.id()))
|
||||
.parent_ids()
|
||||
.iter()
|
||||
.filter(|id| !self.index().has_id(id))
|
||||
.map(|id| self.store().get_commit(id).unwrap())
|
||||
.collect()
|
||||
},
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue