ok/jj
1
0
Fork 0
forked from mirrors/jj

repo: micro-optimize add_head() to not instantiate indexed commit object

This commit is contained in:
Yuya Nishihara 2023-05-20 08:25:41 +09:00
parent 15fb8b95b0
commit 72271c0d1f

View file

@ -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()
}, },
); );