diff options
author | 2011-10-03 22:11:31 -0700 | |
---|---|---|
committer | 2011-10-03 22:11:31 -0700 | |
commit | b2200511e852a8cc94a9bf569de6440ea7eb55f8 (patch) | |
tree | f8a45aff50096889b0ed6565a7d41b6f1624aa75 /java/src/com/android/inputmethod/latin/ExpandableDictionary.java | |
parent | f24396c5dbfa6791b55d6a8d1ac14c13225365b9 (diff) | |
parent | ab72a97d7ce44230a0c824797d1675a5ca354a56 (diff) | |
download | latinime-b2200511e852a8cc94a9bf569de6440ea7eb55f8.tar.gz latinime-b2200511e852a8cc94a9bf569de6440ea7eb55f8.tar.xz latinime-b2200511e852a8cc94a9bf569de6440ea7eb55f8.zip |
am ab72a97d: Cleanup unused import
* commit 'ab72a97d7ce44230a0c824797d1675a5ca354a56':
Cleanup unused import
Diffstat (limited to 'java/src/com/android/inputmethod/latin/ExpandableDictionary.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/ExpandableDictionary.java | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/java/src/com/android/inputmethod/latin/ExpandableDictionary.java b/java/src/com/android/inputmethod/latin/ExpandableDictionary.java index 2b78b9065..cad69bb0e 100644 --- a/java/src/com/android/inputmethod/latin/ExpandableDictionary.java +++ b/java/src/com/android/inputmethod/latin/ExpandableDictionary.java @@ -17,7 +17,6 @@ package com.android.inputmethod.latin; import android.content.Context; -import android.os.AsyncTask; import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.keyboard.ProximityInfo; @@ -166,15 +165,14 @@ public class ExpandableDictionary extends Dictionary { // Does children have the current character? final int childrenLength = children.mLength; Node childNode = null; - boolean found = false; for (int i = 0; i < childrenLength; i++) { - childNode = children.mData[i]; - if (childNode.mCode == c) { - found = true; + final Node node = children.mData[i]; + if (node.mCode == c) { + childNode = node; break; } } - if (!found) { + if (childNode == null) { childNode = new Node(); childNode.mCode = c; childNode.mParent = parentNode; @@ -206,7 +204,7 @@ public class ExpandableDictionary extends Dictionary { } protected final void getWordsInner(final WordComposer codes, final WordCallback callback, - final ProximityInfo proximityInfo) { + @SuppressWarnings("unused") final ProximityInfo proximityInfo) { mInputLength = codes.size(); if (mCodes.length < mInputLength) mCodes = new int[mInputLength][]; // Cache the codes so that we don't have to lookup an array list @@ -270,7 +268,7 @@ public class ExpandableDictionary extends Dictionary { */ // TODO: Share this routine with the native code for BinaryDictionary protected void getWordsRec(NodeArray roots, final WordComposer codes, final char[] word, - final int depth, boolean completion, int snr, int inputIndex, int skipPos, + final int depth, final boolean completion, int snr, int inputIndex, int skipPos, WordCallback callback) { final int count = roots.mLength; final int codeSize = mInputLength; @@ -278,9 +276,9 @@ public class ExpandableDictionary extends Dictionary { if (depth > mMaxDepth) { return; } - int[] currentChars = null; + final int[] currentChars; if (codeSize <= inputIndex) { - completion = true; + currentChars = null; } else { currentChars = mCodes[inputIndex]; } @@ -292,7 +290,7 @@ public class ExpandableDictionary extends Dictionary { final boolean terminal = node.mTerminal; final NodeArray children = node.mChildren; final int freq = node.mFrequency; - if (completion) { + if (completion || currentChars == null) { word[depth] = c; if (terminal) { final int finalFreq; @@ -307,7 +305,7 @@ public class ExpandableDictionary extends Dictionary { } } if (children != null) { - getWordsRec(children, codes, word, depth + 1, completion, snr, inputIndex, + getWordsRec(children, codes, word, depth + 1, true, snr, inputIndex, skipPos, callback); } } else if ((c == Keyboard.CODE_SINGLE_QUOTE @@ -412,15 +410,14 @@ public class ExpandableDictionary extends Dictionary { // Does children have the current character? final int childrenLength = children.mLength; Node childNode = null; - boolean found = false; for (int i = 0; i < childrenLength; i++) { - childNode = children.mData[i]; - if (childNode.mCode == c) { - found = true; + final Node node = children.mData[i]; + if (node.mCode == c) { + childNode = node; break; } } - if (!found) { + if (childNode == null) { childNode = new Node(); childNode.mCode = c; childNode.mParent = parentNode; |