Skip to content

Commit

Permalink
rewrite: drop redundant unioning of old commits with abandoned commits
Browse files Browse the repository at this point in the history
We always add abandoned commits as key in `parent_mapping`.
  • Loading branch information
martinvonz committed Mar 30, 2024
1 parent 2fd9296 commit bfbecfb
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lib/src/rewrite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,7 @@ impl<'settings, 'repo> DescendantRebaser<'settings, 'repo> {
) -> DescendantRebaser<'settings, 'repo> {
let store = mut_repo.store();
let old_commits_expression =
RevsetExpression::commits(mut_repo.parent_mapping.keys().cloned().collect()).union(
&RevsetExpression::commits(mut_repo.abandoned.iter().cloned().collect()),
);
RevsetExpression::commits(mut_repo.parent_mapping.keys().cloned().collect());
let to_visit_expression = old_commits_expression
.descendants()
.minus(&old_commits_expression);
Expand Down Expand Up @@ -499,10 +497,7 @@ impl<'settings, 'repo> DescendantRebaser<'settings, 'repo> {
.collect();

let old_commits_expression =
RevsetExpression::commits(self.mut_repo.parent_mapping.keys().cloned().collect())
.union(&RevsetExpression::commits(
self.mut_repo.abandoned.iter().cloned().collect(),
));
RevsetExpression::commits(self.mut_repo.parent_mapping.keys().cloned().collect());
let heads_to_add_expression = old_commits_expression
.parents()
.minus(&old_commits_expression);
Expand Down

0 comments on commit bfbecfb

Please sign in to comment.