diff options
author | 2012-09-20 20:37:44 +0900 | |
---|---|---|
committer | 2012-09-20 20:37:44 +0900 | |
commit | 379aeb18366f29b8d9d0f90e2fbb0daa3aaeefa4 (patch) | |
tree | 1836a0f65c41e66e65b22c2282c2807935dffe7a /native/jni/src/proximity_info_state.cpp | |
parent | f18fc03621b70f5a51cf54c4bf40eb213de40652 (diff) | |
parent | 54717534b1164c575a14a4a117284e72c6cd0ee0 (diff) | |
download | latinime-379aeb18366f29b8d9d0f90e2fbb0daa3aaeefa4.tar.gz latinime-379aeb18366f29b8d9d0f90e2fbb0daa3aaeefa4.tar.xz latinime-379aeb18366f29b8d9d0f90e2fbb0daa3aaeefa4.zip |
Merge remote-tracking branch 'goog/jb-mr1-dev' into mergescriptpackage
Diffstat (limited to 'native/jni/src/proximity_info_state.cpp')
-rw-r--r-- | native/jni/src/proximity_info_state.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/native/jni/src/proximity_info_state.cpp b/native/jni/src/proximity_info_state.cpp index 9b189183b..c5f2884c6 100644 --- a/native/jni/src/proximity_info_state.cpp +++ b/native/jni/src/proximity_info_state.cpp @@ -409,11 +409,11 @@ bool ProximityInfoState::pushTouchPoint(const int inputIndex, const int nodeChar } NearKeysDistanceMap::const_iterator itPP = prevNearKeysDistances->find(minChar); - if (DEBUG_GEO_FULL) { - AKLOGI("p1: char = %c, minDist = %f, prevNear key minDist = %f", - minChar, itPP->second, minDist); - } if (itPP != prevNearKeysDistances->end() && minDist > itPP->second) { + if (DEBUG_GEO_FULL) { + AKLOGI("p1: char = %c, minDist = %f, prevNear key minDist = %f", + minChar, itPP->second, minDist); + } return popped; } } @@ -464,8 +464,8 @@ float ProximityInfoState::calculateNormalizedSquaredDistance( } int ProximityInfoState::getDuration(const int index) const { - if (mInputSize > 0 && index > 0 && index < mInputSize - 1) { - return mTimes[index + 1] - mTimes[index - 1]; + if (mInputSize > 0 && index >= 0 && index < mInputSize - 1) { + return mTimes[index + 1] - mTimes[index]; } return 0; } @@ -504,7 +504,7 @@ int32_t ProximityInfoState::getAllPossibleChars( if (index >= mInputXs.size()) { return filterSize; } - int i = filterSize; + int newFilterSize = filterSize; for (int j = 0; j < mProximityInfo->getKeyCount(); ++j) { if (mNearKeysVector[index].test(j)) { const int32_t keyCodePoint = mProximityInfo->getCodePointOf(j); @@ -517,11 +517,11 @@ int32_t ProximityInfoState::getAllPossibleChars( } } if (insert) { - filter[i++] = keyCodePoint; + filter[newFilterSize++] = keyCodePoint; } } } - return i; + return newFilterSize; } float ProximityInfoState::getAveragePointDuration() const { |