Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/syntax/src/syntax_editor/edit_algo.rs')
-rw-r--r--crates/syntax/src/syntax_editor/edit_algo.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/crates/syntax/src/syntax_editor/edit_algo.rs b/crates/syntax/src/syntax_editor/edit_algo.rs
index 38c786b0f5..36f50e3918 100644
--- a/crates/syntax/src/syntax_editor/edit_algo.rs
+++ b/crates/syntax/src/syntax_editor/edit_algo.rs
@@ -111,11 +111,8 @@ pub(super) fn apply_edits(editor: SyntaxEditor) -> SyntaxEdit {
// Check if this change is dependent on another change (i.e. it's contained within another range)
if let Some(index) = changed_ancestors
.iter()
- .rev()
- .position(|ancestor| ancestor.affected_range().contains_range(change.target_range()))
+ .rposition(|ancestor| ancestor.affected_range().contains_range(change.target_range()))
{
- let index = changed_ancestors.len() - 1 - index;
-
// Pop off any ancestors that aren't applicable
changed_ancestors.drain((index + 1)..);