forked from mirrors/jj
refs: simplify inner loop of find_pair_to_remove() too
This commit is contained in:
parent
fe3be99f0d
commit
528f6e23c1
1 changed files with 5 additions and 4 deletions
|
@ -87,10 +87,11 @@ fn find_pair_to_remove(
|
|||
if removes.is_empty() {
|
||||
return Some((None, add_index));
|
||||
}
|
||||
for (remove_index, remove) in removes.iter().enumerate() {
|
||||
if index.is_ancestor(remove, add) {
|
||||
return Some((Some(remove_index), add_index));
|
||||
}
|
||||
if let Some(remove_index) = removes
|
||||
.iter()
|
||||
.position(|remove| index.is_ancestor(remove, add))
|
||||
{
|
||||
return Some((Some(remove_index), add_index));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue