Inline a wrapper method (A101)

Change-Id: I6ce856ff49a8f8c696851b2487590704010fc758
main
Jean Chalard 2012-07-10 20:47:01 +09:00
parent eb1443883f
commit d6c610400e
1 changed files with 4 additions and 14 deletions

View File

@ -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,