diff options
author | 2012-06-27 20:35:25 +0900 | |
---|---|---|
committer | 2012-06-28 19:10:13 +0900 | |
commit | b7cdafd78a7e97c70ceaa3349197eb012e69cc3f (patch) | |
tree | a151be05b70c7731219d6e1cbe7ee9b3087939fb /java/src/com/android/inputmethod/latin/Suggest.java | |
parent | 09b30ac95472195c37e5d32838dc3734c0310937 (diff) | |
download | latinime-b7cdafd78a7e97c70ceaa3349197eb012e69cc3f.tar.gz latinime-b7cdafd78a7e97c70ceaa3349197eb012e69cc3f.tar.xz latinime-b7cdafd78a7e97c70ceaa3349197eb012e69cc3f.zip |
Don't pass everything to a function that needs only the head (A2)
Change-Id: Ic367836202ab8071c1a9a02eaf0651b0da947d51
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Suggest.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/Suggest.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index 08a7b869d..baf24c8ae 100644 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -249,6 +249,8 @@ public class Suggest { transformedWordInfo.mSourceDict); } + final SuggestedWordInfo bestSuggestion = suggestionsContainer.isEmpty() + ? null : suggestionsContainer.get(0); final CharSequence whitelistedWord = capitalizeWord(isAllUpperCase, isFirstCharCapitalized, mWhiteListDictionary.getWhitelistedWord(consideredWord)); @@ -256,7 +258,7 @@ public class Suggest { if (isCorrectionEnabled) { final CharSequence autoCorrection = AutoCorrection.computeAutoCorrectionWord(mDictionaries, wordComposer, - suggestionsContainer, consideredWord, mAutoCorrectionThreshold, + bestSuggestion, consideredWord, mAutoCorrectionThreshold, whitelistedWord); hasAutoCorrection = (null != autoCorrection); } else { |