Skip to content

Commit

Permalink
rewrite: remove redundant commit_id.clone() from merge_commit_trees*()
Browse files Browse the repository at this point in the history
  • Loading branch information
yuja committed Aug 10, 2024
1 parent 61e4bd4 commit 9faf687
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/rewrite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub fn merge_commit_trees_without_repo(
.map(|commit| commit.id().clone())
.collect_vec();
for (i, other_commit) in commits.iter().enumerate().skip(1) {
let ancestor_ids = index.common_ancestors(&commit_ids[0..i], &[commit_ids[i].clone()]);
let ancestor_ids = index.common_ancestors(&commit_ids[0..i], &commit_ids[i..][..1]);
let ancestors: Vec<_> = ancestor_ids
.iter()
.map(|id| store.get_commit(id))
Expand Down

0 comments on commit 9faf687

Please sign in to comment.