Skip to content

Commit

Permalink
suggester: Adjust swap_idx in move_char_suggest to be absolute
Browse files Browse the repository at this point in the history
  • Loading branch information
the-mikedavis committed Sep 25, 2024
1 parent 96968a1 commit 4f9a194
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/suggester.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ impl<'a, S: BuildHasher> Suggester<'a, S> {
if remaining_attempts == 0 {
unsafe {
let bytes = buffer.as_bytes_mut();
bytes[idx1..swap_idx].rotate_right(ch1.len_utf8());
bytes[idx1..swap_idx + idx2].rotate_right(ch1.len_utf8());
}
debug_assert_eq!(word, &*buffer);
return;
Expand Down

0 comments on commit 4f9a194

Please sign in to comment.