diff options
author | 2012-03-09 15:52:23 +0900 | |
---|---|---|
committer | 2012-03-09 15:52:23 +0900 | |
commit | 838629aea00ce90231df97f1dae3d8273ba80cbd (patch) | |
tree | dd08b7a1a2149cfccd1bc9b01e1845eca829e2bd /java/src | |
parent | d48b76267a8acb400bf3462cb787505d5bd8d12c (diff) | |
download | latinime-838629aea00ce90231df97f1dae3d8273ba80cbd.tar.gz latinime-838629aea00ce90231df97f1dae3d8273ba80cbd.tar.xz latinime-838629aea00ce90231df97f1dae3d8273ba80cbd.zip |
Remove useless test
typedWord may not be null here
Change-Id: I9e7afb89fafbf6fcbc91fbc132aecc06aec8979f
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 13ba44be0..a3f422c9c 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1853,21 +1853,19 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // in most cases, suggestion count is 1 when typed word's length is 1, but we do always // need to clear the previous state when the user starts typing a word (i.e. typed word's // length == 1). - if (typedWord != null) { - if (builder.size() > 1 || typedWord.length() == 1 || (!allowsToBeAutoCorrected) - || mSuggestionsView.isShowingAddToDictionaryHint()) { - builder.setTypedWordValid(!allowsToBeAutoCorrected).setHasMinimalSuggestion( - autoCorrectionAvailable); - } else { - SuggestedWords previousSuggestions = mSuggestionsView.getSuggestions(); - if (previousSuggestions == mSettingsValues.mSuggestPuncList) { - if (builder.size() == 0) { - return; - } - previousSuggestions = SuggestedWords.EMPTY; + if (builder.size() > 1 || typedWord.length() == 1 || (!allowsToBeAutoCorrected) + || mSuggestionsView.isShowingAddToDictionaryHint()) { + builder.setTypedWordValid(!allowsToBeAutoCorrected).setHasMinimalSuggestion( + autoCorrectionAvailable); + } else { + SuggestedWords previousSuggestions = mSuggestionsView.getSuggestions(); + if (previousSuggestions == mSettingsValues.mSuggestPuncList) { + if (builder.size() == 0) { + return; } - builder.addTypedWordAndPreviousSuggestions(typedWord, previousSuggestions); + previousSuggestions = SuggestedWords.EMPTY; } + builder.addTypedWordAndPreviousSuggestions(typedWord, previousSuggestions); } if (Suggest.shouldBlockAutoCorrectionBySafetyNet(builder, mSuggest, mSettingsValues.mAutoCorrectionThreshold)) { |