aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-07-11 12:56:57 +0900
committerJean Chalard <jchalard@google.com>2012-07-12 14:30:00 +0900
commit251f302985bc491f4dd54983e9c69c5dc76cb834 (patch)
tree50496208d55c65f3b3392c074fab6c6ca131281b /java/src
parentcc470c78e4538ec05ed78959da041e2ce5ba846a (diff)
downloadlatinime-251f302985bc491f4dd54983e9c69c5dc76cb834.tar.gz
latinime-251f302985bc491f4dd54983e9c69c5dc76cb834.tar.xz
latinime-251f302985bc491f4dd54983e9c69c5dc76cb834.zip
Stop using a redundant method (A108)
Change-Id: Iffc0bae0a273419e7c50d69526c0c8e402c6461c
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/BinaryDictionary.java23
1 files changed, 9 insertions, 14 deletions
diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionary.java b/java/src/com/android/inputmethod/latin/BinaryDictionary.java
index db8d3077d..271119bfb 100644
--- a/java/src/com/android/inputmethod/latin/BinaryDictionary.java
+++ b/java/src/com/android/inputmethod/latin/BinaryDictionary.java
@@ -124,22 +124,17 @@ public class BinaryDictionary extends Dictionary {
}
}
- final int count;
- if (!isGesture && composerSize <= 1) {
- if (TextUtils.isEmpty(prevWord)) return null;
- int tmpCount = getBigramsNative(mNativeDict, prevWordCodePointArray,
- prevWordCodePointArray.length, mInputCodes, composerSize,
- mOutputChars, mOutputScores);
- count = Math.min(tmpCount, MAX_PREDICTIONS);
- } else {
- final InputPointers ips = composer.getInputPointers();
- final int codesSize = isGesture ? ips.getPointerSize() : composerSize;
- // proximityInfo and/or prevWordForBigrams may not be null.
- count = getSuggestionsNative(mNativeDict, proximityInfo.getNativeProximityInfo(),
- ips.getXCoordinates(), ips.getYCoordinates(), ips.getTimes(), ips.getPointerIds(),
+ // TODO: move this test to native code.
+ if (composerSize <= 1 && TextUtils.isEmpty(prevWord)) return null;
+ final InputPointers ips = composer.getInputPointers();
+ final int codesSize = isGesture ? ips.getPointerSize() : composerSize;
+ // proximityInfo and/or prevWordForBigrams may not be null.
+ final int tmpCount = getSuggestionsNative(mNativeDict,
+ proximityInfo.getNativeProximityInfo(), ips.getXCoordinates(),
+ ips.getYCoordinates(), ips.getTimes(), ips.getPointerIds(),
mInputCodes, codesSize, 0 /* unused */, isGesture, prevWordCodePointArray,
mUseFullEditDistance, mOutputChars, mOutputScores, mSpaceIndices);
- }
+ final int count = Math.min(tmpCount, MAX_PREDICTIONS);
final ArrayList<SuggestedWordInfo> suggestions = new ArrayList<SuggestedWordInfo>();
for (int j = 0; j < count; ++j) {