Skip to content

Commit fe5a51e

Browse files
committed
Optimization of the request of the sentence level spell check
Change-Id: Ic89b0dd027bf0af6e8f1877043ae40baed48b2a4
1 parent 2428ccb commit fe5a51e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/java/android/widget/SpellChecker.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,10 @@ public void parse() {
488488
editable.removeSpan(mRange);
489489
return;
490490
}
491+
// Stop spell checking when there are no characters in the range.
492+
if (wordEnd < start) {
493+
return;
494+
}
491495
wordStart = regionEnd;
492496
// TODO: Find the start position of the sentence.
493497
// Set span with the context

0 commit comments

Comments
 (0)