Skip to content

Commit ebcee96

Browse files
committed
use different combinator
1 parent 275c5c4 commit ebcee96

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

crates/syntax/src/syntax_editor/edit_algo.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,8 @@ pub(super) fn apply_edits(editor: SyntaxEditor) -> SyntaxEdit {
111111
// Check if this change is dependent on another change (i.e. it's contained within another range)
112112
if let Some(index) = changed_ancestors
113113
.iter()
114-
.rev()
115-
.position(|ancestor| ancestor.affected_range().contains_range(change.target_range()))
114+
.rposition(|ancestor| ancestor.affected_range().contains_range(change.target_range()))
116115
{
117-
let index = changed_ancestors.len() - 1 - index;
118-
119116
// Pop off any ancestors that aren't applicable
120117
changed_ancestors.drain((index + 1)..);
121118

0 commit comments

Comments
 (0)