Remove useless tests (B5)
WordComposer#getTypedWord() may not return null. Don't test for it.
Change-Id: I6aff14892503d0c275a3328c404ed99d2f40a687
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index 471b245..9eed322 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -281,11 +281,9 @@
final String consideredWord = mTrailingSingleQuotesCount > 0
? typedWord.substring(0, typedWord.length() - mTrailingSingleQuotesCount)
: typedWord;
- if (typedWord != null) {
- // Treating USER_TYPED as UNIGRAM suggestion for logging now.
- LatinImeLogger.onAddSuggestedWord(typedWord, Suggest.DIC_USER_TYPED,
- Dictionary.UNIGRAM);
- }
+ // Treating USER_TYPED as UNIGRAM suggestion for logging now.
+ LatinImeLogger.onAddSuggestedWord(typedWord, Suggest.DIC_USER_TYPED,
+ Dictionary.UNIGRAM);
mConsideredWord = consideredWord;
if (wordComposer.size() <= 1 && (correctionMode == CORRECTION_FULL_BIGRAM)) {
@@ -344,8 +342,7 @@
}
}
}
- final String consideredWordString =
- consideredWord == null ? null : consideredWord.toString();
+ final String consideredWordString = consideredWord.toString();
CharSequence whitelistedWord = capitalizeWord(mIsAllUpperCase, mIsFirstCharCapitalized,
mWhiteListDictionary.getWhitelistedWord(consideredWordString));
@@ -373,9 +370,7 @@
}
}
- if (typedWord != null) {
- mSuggestions.add(0, typedWord.toString());
- }
+ mSuggestions.add(0, typedWord.toString());
StringUtils.removeDupes(mSuggestions);
if (DBG) {