From d6c610400e910ef2870371439c7d940842a1b73d Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Tue, 10 Jul 2012 20:47:01 +0900 Subject: Inline a wrapper method (A101) Change-Id: I6ce856ff49a8f8c696851b2487590704010fc758 --- .../android/inputmethod/latin/BinaryDictionary.java | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'java/src') diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionary.java b/java/src/com/android/inputmethod/latin/BinaryDictionary.java index 3b294462e..90a037372 100644 --- a/java/src/com/android/inputmethod/latin/BinaryDictionary.java +++ b/java/src/com/android/inputmethod/latin/BinaryDictionary.java @@ -126,7 +126,10 @@ public class BinaryDictionary extends Dictionary { final int count; if (!composer.isBatchMode() && composer.size() <= 1) { if (TextUtils.isEmpty(prevWord)) return null; - count = getBigramsInternal(composer, prevWordCodePointArray); + int tmpCount = getBigramsNative(mNativeDict, prevWordCodePointArray, + prevWordCodePointArray.length, mInputCodes, composerSize, + mOutputChars, mOutputScores, MAX_WORD_LENGTH, MAX_BIGRAMS); + count = Math.min(tmpCount, MAX_BIGRAMS); } else { count = getWordsInternal(composer, prevWordCodePointArray, proximityInfo); } @@ -147,19 +150,6 @@ public class BinaryDictionary extends Dictionary { return suggestions; } - // TODO: move to native code - private int getBigramsInternal(final WordComposer codes, - final int[] previousWord) { - int codesSize = codes.size(); - - int count = getBigramsNative(mNativeDict, previousWord, previousWord.length, mInputCodes, - codesSize, mOutputChars, mOutputScores, MAX_WORD_LENGTH, MAX_BIGRAMS); - if (count > MAX_BIGRAMS) { - count = MAX_BIGRAMS; - } - return count; - } - // TODO: move to native code // proximityInfo and/or prevWordForBigrams may not be null. private int getWordsInternal(final WordComposer codes, -- cgit v1.2.3-83-g751a