forked from mirrors/jj
revset: do not evaluate roots() candidates three times
This commit is contained in:
parent
eef6a77aa4
commit
ddff089286
1 changed files with 4 additions and 2 deletions
|
@ -688,8 +688,10 @@ impl<'index, 'heads> EvaluationContext<'index, 'heads> {
|
||||||
.revset_for_commit_ids(&self.composite_index.heads(&mut candidate_ids.iter())))
|
.revset_for_commit_ids(&self.composite_index.heads(&mut candidate_ids.iter())))
|
||||||
}
|
}
|
||||||
RevsetExpression::Roots(candidates) => {
|
RevsetExpression::Roots(candidates) => {
|
||||||
let candidate_set = self.evaluate(candidates)?;
|
let candidate_set = EagerRevset {
|
||||||
let (_, filled) = self.collect_dag_range(&*candidate_set, &*candidate_set);
|
index_entries: self.evaluate(candidates)?.iter().collect(),
|
||||||
|
};
|
||||||
|
let (_, filled) = self.collect_dag_range(&candidate_set, &candidate_set);
|
||||||
let mut index_entries = vec![];
|
let mut index_entries = vec![];
|
||||||
for candidate in candidate_set.iter() {
|
for candidate in candidate_set.iter() {
|
||||||
if !candidate
|
if !candidate
|
||||||
|
|
Loading…
Reference in a new issue