Inline a method (A17)
This will allow us to remove unnecessary processing
Change-Id: I251dfdaffb077906186686ebe65fd82e1e360bd2
diff --git a/java/src/com/android/inputmethod/latin/AutoCorrection.java b/java/src/com/android/inputmethod/latin/AutoCorrection.java
index e3e7cc2..0d90b1c 100644
--- a/java/src/com/android/inputmethod/latin/AutoCorrection.java
+++ b/java/src/com/android/inputmethod/latin/AutoCorrection.java
@@ -88,13 +88,6 @@
return !isValidWord(dictionaries, word, ignoreCase);
}
- public static boolean shouldAutoCorrectToSelf(
- final ConcurrentHashMap<String, Dictionary> dictionaries,
- final CharSequence consideredWord) {
- return (!TextUtils.isEmpty(consideredWord) && !allowsToBeAutoCorrected(dictionaries,
- consideredWord, false));
- }
-
public static boolean hasAutoCorrectionForBinaryDictionary(SuggestedWordInfo suggestion,
CharSequence consideredWord, float autoCorrectionThreshold) {
if (null != suggestion) {
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index ed00937..aa85d89 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -233,7 +233,8 @@
final CharSequence autoCorrection;
if (null != whitelistedWord) {
autoCorrection = whitelistedWord;
- } else if (AutoCorrection.shouldAutoCorrectToSelf(mDictionaries, consideredWord)) {
+ } else if (!TextUtils.isEmpty(consideredWord) &&
+ !AutoCorrection.allowsToBeAutoCorrected(mDictionaries, consideredWord, false)) {
autoCorrection = consideredWord;
} else if (AutoCorrection.hasAutoCorrectionForBinaryDictionary(bestSuggestion,
consideredWord, mAutoCorrectionThreshold)) {