From 394b0bd345f33b1314613a433478fd0bb711e0f7 Mon Sep 17 00:00:00 2001
From: Satoshi Kataoka <satok@google.com>
Date: Fri, 29 Mar 2013 18:49:50 +0900
Subject: [PATCH] Refactor

Change-Id: Ie50fdd1081d306e520300245498a605e79e03818
---
 native/jni/src/proximity_info_state.cpp       | 12 +++++++-----
 native/jni/src/proximity_info_state.h         | 18 +++++++++---------
 native/jni/src/proximity_info_state_utils.cpp |  8 ++++----
 native/jni/src/proximity_info_state_utils.h   |  2 +-
 4 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/native/jni/src/proximity_info_state.cpp b/native/jni/src/proximity_info_state.cpp
index 7fcfd5dc8d..861ba99713 100644
--- a/native/jni/src/proximity_info_state.cpp
+++ b/native/jni/src/proximity_info_state.cpp
@@ -33,11 +33,13 @@ void ProximityInfoState::initInputParams(const int pointerId, const float maxPoi
         const int *const xCoordinates, const int *const yCoordinates, const int *const times,
         const int *const pointerIds, const bool isGeometric) {
     ASSERT(isGeometric || (inputSize < MAX_WORD_LENGTH));
-    mIsContinuationPossible = ProximityInfoStateUtils::checkAndReturnIsContinuationPossible(
-            inputSize, xCoordinates, yCoordinates, times, mSampledInputSize, &mSampledInputXs,
-            &mSampledInputYs, &mSampledTimes, &mSampledInputIndice);
+    mIsContinuousSuggestionPossible =
+            ProximityInfoStateUtils::checkAndReturnIsContinuousSuggestionPossible(
+                    inputSize, xCoordinates, yCoordinates, times, mSampledInputSize,
+                    &mSampledInputXs, &mSampledInputYs, &mSampledTimes, &mSampledInputIndice);
     if (DEBUG_DICT) {
-        AKLOGI("isContinuationPossible = %s", (mIsContinuationPossible ? "true" : "false"));
+        AKLOGI("isContinuousSuggestionPossible = %s",
+                (mIsContinuousSuggestionPossible ? "true" : "false"));
     }
 
     mProximityInfo = proximityInfo;
@@ -64,7 +66,7 @@ void ProximityInfoState::initInputParams(const int pointerId, const float maxPoi
     mSampledInputSize = 0;
     mMostProbableStringProbability = 0.0f;
 
-    if (mIsContinuationPossible && mSampledInputIndice.size() > 1) {
+    if (mIsContinuousSuggestionPossible && mSampledInputIndice.size() > 1) {
         // Just update difference.
         // Previous two points are never skipped. Thus, we pop 2 input point data here.
         pushTouchPointStartIndex = ProximityInfoStateUtils::trimLastTwoTouchPoints(
diff --git a/native/jni/src/proximity_info_state.h b/native/jni/src/proximity_info_state.h
index 224240b00f..9bba751d02 100644
--- a/native/jni/src/proximity_info_state.h
+++ b/native/jni/src/proximity_info_state.h
@@ -47,12 +47,12 @@ class ProximityInfoState {
             : mProximityInfo(0), mMaxPointToKeyLength(0.0f), mAverageSpeed(0.0f),
               mHasTouchPositionCorrectionData(false), mMostCommonKeyWidthSquare(0),
               mKeyCount(0), mCellHeight(0), mCellWidth(0), mGridHeight(0), mGridWidth(0),
-              mIsContinuationPossible(false), mSampledInputXs(), mSampledInputYs(), mSampledTimes(),
-              mSampledInputIndice(), mSampledLengthCache(), mBeelineSpeedPercentiles(),
-              mSampledDistanceCache_G(), mSpeedRates(), mDirections(), mCharProbabilities(),
-              mSampledNearKeySets(), mSampledSearchKeySets(), mSampledSearchKeyVectors(),
-              mTouchPositionCorrectionEnabled(false), mSampledInputSize(0),
-              mMostProbableStringProbability(0.0f) {
+              mIsContinuousSuggestionPossible(false), mSampledInputXs(), mSampledInputYs(),
+              mSampledTimes(), mSampledInputIndice(), mSampledLengthCache(),
+              mBeelineSpeedPercentiles(), mSampledDistanceCache_G(), mSpeedRates(), mDirections(),
+              mCharProbabilities(), mSampledNearKeySets(), mSampledSearchKeySets(),
+              mSampledSearchKeyVectors(), mTouchPositionCorrectionEnabled(false),
+              mSampledInputSize(0), mMostProbableStringProbability(0.0f) {
         memset(mInputProximities, 0, sizeof(mInputProximities));
         memset(mNormalizedSquaredDistances, 0, sizeof(mNormalizedSquaredDistances));
         memset(mPrimaryInputWord, 0, sizeof(mPrimaryInputWord));
@@ -143,8 +143,8 @@ class ProximityInfoState {
         return mSampledLengthCache[index];
     }
 
-    bool isContinuationPossible() const {
-        return mIsContinuationPossible;
+    bool isContinuousSuggestionPossible() const {
+        return mIsContinuousSuggestionPossible;
     }
 
     float getPointToKeyByIdLength(const int inputIndex, const int keyId) const;
@@ -223,7 +223,7 @@ class ProximityInfoState {
     int mCellWidth;
     int mGridHeight;
     int mGridWidth;
-    bool mIsContinuationPossible;
+    bool mIsContinuousSuggestionPossible;
 
     std::vector<int> mSampledInputXs;
     std::vector<int> mSampledInputYs;
diff --git a/native/jni/src/proximity_info_state_utils.cpp b/native/jni/src/proximity_info_state_utils.cpp
index ccb28bc8c9..760508076b 100644
--- a/native/jni/src/proximity_info_state_utils.cpp
+++ b/native/jni/src/proximity_info_state_utils.cpp
@@ -968,10 +968,10 @@ namespace latinime {
     return true;
 }
 
-/* static */ bool ProximityInfoStateUtils::checkAndReturnIsContinuationPossible(const int inputSize,
-        const int *const xCoordinates, const int *const yCoordinates, const int *const times,
-        const int sampledInputSize, const std::vector<int> *const sampledInputXs,
-        const std::vector<int> *const sampledInputYs,
+/* static */ bool ProximityInfoStateUtils::checkAndReturnIsContinuousSuggestionPossible(
+        const int inputSize, const int *const xCoordinates, const int *const yCoordinates,
+        const int *const times, const int sampledInputSize,
+        const std::vector<int> *const sampledInputXs, const std::vector<int> *const sampledInputYs,
         const std::vector<int> *const sampledTimes,
         const std::vector<int> *const sampledInputIndices) {
     if (inputSize < sampledInputSize) {
diff --git a/native/jni/src/proximity_info_state_utils.h b/native/jni/src/proximity_info_state_utils.h
index a7f4a34251..3ceb25d8b3 100644
--- a/native/jni/src/proximity_info_state_utils.h
+++ b/native/jni/src/proximity_info_state_utils.h
@@ -101,7 +101,7 @@ class ProximityInfoStateUtils {
             const std::vector<int> *const sampledTimes,
             const std::vector<float> *const sampledSpeedRates,
             const std::vector<int> *const sampledBeelineSpeedPercentiles);
-    static bool checkAndReturnIsContinuationPossible(const int inputSize,
+    static bool checkAndReturnIsContinuousSuggestionPossible(const int inputSize,
             const int *const xCoordinates, const int *const yCoordinates, const int *const times,
             const int sampledInputSize, const std::vector<int> *const sampledInputXs,
             const std::vector<int> *const sampledInputYs,
-- 
GitLab