Inline a wrapper method (A101)

Change-Id: I6ce856ff49a8f8c696851b2487590704010fc758
This commit is contained in:
Jean Chalard 2012-07-10 20:47:01 +09:00
parent eb1443883f
commit d6c610400e

View file

@ -126,7 +126,10 @@ public class BinaryDictionary extends Dictionary {
final int count; final int count;
if (!composer.isBatchMode() && composer.size() <= 1) { if (!composer.isBatchMode() && composer.size() <= 1) {
if (TextUtils.isEmpty(prevWord)) return null; 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 { } else {
count = getWordsInternal(composer, prevWordCodePointArray, proximityInfo); count = getWordsInternal(composer, prevWordCodePointArray, proximityInfo);
} }
@ -147,19 +150,6 @@ public class BinaryDictionary extends Dictionary {
return suggestions; 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 // TODO: move to native code
// proximityInfo and/or prevWordForBigrams may not be null. // proximityInfo and/or prevWordForBigrams may not be null.
private int getWordsInternal(final WordComposer codes, private int getWordsInternal(final WordComposer codes,