am 45e34b43: [CB24] Remove a useless test

* commit '45e34b43744b75a76cfe09d5026026af83f24de0':
  [CB24] Remove a useless test
main
Jean Chalard 2014-04-08 13:09:22 +00:00 committed by Android Git Automerger
commit 74058b0ee1
1 changed files with 13 additions and 11 deletions

View File

@ -253,18 +253,20 @@ public final class BinaryDictionary extends Dictionary {
// TODO: toLowerCase in the native code // TODO: toLowerCase in the native code
final int[] prevWordCodePointArray = (null == prevWord) final int[] prevWordCodePointArray = (null == prevWord)
? null : StringUtils.toCodePointArray(prevWord); ? null : StringUtils.toCodePointArray(prevWord);
final int composerSize = composer.sizeWithoutTrailingSingleQuotes(); final InputPointers inputPointers = composer.getInputPointers();
final boolean isGesture = composer.isBatchMode(); final boolean isGesture = composer.isBatchMode();
if (composerSize <= 1 || !isGesture) { final int inputSize;
if (!isGesture) {
final int composerSize = composer.sizeWithoutTrailingSingleQuotes();
if (composerSize > MAX_WORD_LENGTH - 1) return null; if (composerSize > MAX_WORD_LENGTH - 1) return null;
for (int i = 0; i < composerSize; i++) { for (int i = 0; i < composerSize; i++) {
mInputCodePoints[i] = composer.getCodeAt(i); mInputCodePoints[i] = composer.getCodeAt(i);
} }
inputSize = composerSize;
} else {
inputSize = inputPointers.getPointerSize();
} }
final InputPointers ips = composer.getInputPointers();
final int inputSize = isGesture ? ips.getPointerSize() : composerSize;
mNativeSuggestOptions.setIsGesture(isGesture); mNativeSuggestOptions.setIsGesture(isGesture);
mNativeSuggestOptions.setAdditionalFeaturesOptions(additionalFeaturesOptions); mNativeSuggestOptions.setAdditionalFeaturesOptions(additionalFeaturesOptions);
if (inOutLanguageWeight != null) { if (inOutLanguageWeight != null) {
@ -274,12 +276,12 @@ public final class BinaryDictionary extends Dictionary {
} }
// proximityInfo and/or prevWordForBigrams may not be null. // proximityInfo and/or prevWordForBigrams may not be null.
getSuggestionsNative(mNativeDict, proximityInfo.getNativeProximityInfo(), getSuggestionsNative(mNativeDict, proximityInfo.getNativeProximityInfo(),
getTraverseSession(sessionId).getSession(), ips.getXCoordinates(), getTraverseSession(sessionId).getSession(), inputPointers.getXCoordinates(),
ips.getYCoordinates(), ips.getTimes(), ips.getPointerIds(), mInputCodePoints, inputPointers.getYCoordinates(), inputPointers.getTimes(),
inputSize, mNativeSuggestOptions.getOptions(), inputPointers.getPointerIds(), mInputCodePoints, inputSize,
prevWordCodePointArray, mOutputSuggestionCount, mOutputCodePoints, mOutputScores, mNativeSuggestOptions.getOptions(), prevWordCodePointArray, mOutputSuggestionCount,
mSpaceIndices, mOutputTypes, mOutputAutoCommitFirstWordConfidence, mOutputCodePoints, mOutputScores, mSpaceIndices, mOutputTypes,
mInputOutputLanguageWeight); mOutputAutoCommitFirstWordConfidence, mInputOutputLanguageWeight);
if (inOutLanguageWeight != null) { if (inOutLanguageWeight != null) {
inOutLanguageWeight[0] = mInputOutputLanguageWeight[0]; inOutLanguageWeight[0] = mInputOutputLanguageWeight[0];
} }