From 2bb29c4674ee2935a54c5664c9ae5a690202f245 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Thu, 8 Mar 2012 19:50:47 +0900 Subject: [PATCH] Simplification Change-Id: Ibced83da2398f1e9ab6a0d6a22c2ad7c8f25cb7b --- java/src/com/android/inputmethod/latin/AutoCorrection.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/AutoCorrection.java b/java/src/com/android/inputmethod/latin/AutoCorrection.java index bcb78919d..bb366d6bd 100644 --- a/java/src/com/android/inputmethod/latin/AutoCorrection.java +++ b/java/src/com/android/inputmethod/latin/AutoCorrection.java @@ -25,18 +25,16 @@ import java.util.Map; public class AutoCorrection { private static final boolean DBG = LatinImeLogger.sDBG; private static final String TAG = AutoCorrection.class.getSimpleName(); - private boolean mHasAutoCorrection; private CharSequence mAutoCorrectionWord; private double mNormalizedScore; public void init() { - mHasAutoCorrection = false; mAutoCorrectionWord = null; mNormalizedScore = Integer.MIN_VALUE; } public boolean hasAutoCorrection() { - return mHasAutoCorrection; + return null != mAutoCorrectionWord; } public CharSequence getAutoCorrectionWord() { @@ -52,15 +50,12 @@ public class AutoCorrection { CharSequence typedWord, double autoCorrectionThreshold, int correctionMode, CharSequence whitelistedWord) { if (hasAutoCorrectionForWhitelistedWord(whitelistedWord)) { - mHasAutoCorrection = true; mAutoCorrectionWord = whitelistedWord; } else if (hasAutoCorrectionForTypedWord( dictionaries, wordComposer, suggestions, typedWord, correctionMode)) { - mHasAutoCorrection = true; mAutoCorrectionWord = typedWord; } else if (hasAutoCorrectionForBinaryDictionary(wordComposer, suggestions, correctionMode, sortedScores, typedWord, autoCorrectionThreshold)) { - mHasAutoCorrection = true; mAutoCorrectionWord = suggestions.get(0); } }