Remove useless tests (B5)

WordComposer#getTypedWord() may not return null. Don't test for it.

Change-Id: I6aff14892503d0c275a3328c404ed99d2f40a687
main
Jean Chalard 2012-03-09 14:48:03 +09:00
parent 8cd847c2fa
commit 92146f2926
1 changed files with 5 additions and 10 deletions

View File

@ -281,11 +281,9 @@ public class Suggest implements Dictionary.WordCallback {
final String consideredWord = mTrailingSingleQuotesCount > 0 final String consideredWord = mTrailingSingleQuotesCount > 0
? typedWord.substring(0, typedWord.length() - mTrailingSingleQuotesCount) ? typedWord.substring(0, typedWord.length() - mTrailingSingleQuotesCount)
: typedWord; : typedWord;
if (typedWord != null) { // Treating USER_TYPED as UNIGRAM suggestion for logging now.
// Treating USER_TYPED as UNIGRAM suggestion for logging now. LatinImeLogger.onAddSuggestedWord(typedWord, Suggest.DIC_USER_TYPED,
LatinImeLogger.onAddSuggestedWord(typedWord, Suggest.DIC_USER_TYPED, Dictionary.UNIGRAM);
Dictionary.UNIGRAM);
}
mConsideredWord = consideredWord; mConsideredWord = consideredWord;
if (wordComposer.size() <= 1 && (correctionMode == CORRECTION_FULL_BIGRAM)) { if (wordComposer.size() <= 1 && (correctionMode == CORRECTION_FULL_BIGRAM)) {
@ -344,8 +342,7 @@ public class Suggest implements Dictionary.WordCallback {
} }
} }
} }
final String consideredWordString = final String consideredWordString = consideredWord.toString();
consideredWord == null ? null : consideredWord.toString();
CharSequence whitelistedWord = capitalizeWord(mIsAllUpperCase, mIsFirstCharCapitalized, CharSequence whitelistedWord = capitalizeWord(mIsAllUpperCase, mIsFirstCharCapitalized,
mWhiteListDictionary.getWhitelistedWord(consideredWordString)); mWhiteListDictionary.getWhitelistedWord(consideredWordString));
@ -373,9 +370,7 @@ public class Suggest implements Dictionary.WordCallback {
} }
} }
if (typedWord != null) { mSuggestions.add(0, typedWord.toString());
mSuggestions.add(0, typedWord.toString());
}
StringUtils.removeDupes(mSuggestions); StringUtils.removeDupes(mSuggestions);
if (DBG) { if (DBG) {