rewrite: drop redundant unioning of old commits with abandoned commits

We always add abandoned commits as key in `parent_mapping`.
This commit is contained in:
Martin von Zweigbergk 2024-03-29 23:13:01 -07:00 committed by Martin von Zweigbergk
parent db4b905bc9
commit bb1fef3258

View file

@ -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);
@ -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);