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| commit.id().clone(),
|
||||||
|commit: &Commit| -> Vec<Commit> {
|
|commit: &Commit| -> Vec<Commit> {
|
||||||
commit
|
commit
|
||||||
.parents()
|
.parent_ids()
|
||||||
.into_iter()
|
.iter()
|
||||||
.filter(|parent| !self.index().has_id(parent.id()))
|
.filter(|id| !self.index().has_id(id))
|
||||||
|
.map(|id| self.store().get_commit(id).unwrap())
|
||||||
.collect()
|
.collect()
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue