diff options
author | 2014-01-15 14:55:57 -0800 | |
---|---|---|
committer | 2014-01-15 14:55:57 -0800 | |
commit | d78a447d107ae60d2bb8f16a1b9797f5ebad2277 (patch) | |
tree | 1d421bd74157c9598d2b19d57315434b3c8ec4e4 /native/jni/src | |
parent | 118a4fc2b7fc4f0ba1de78eb0ef72b473a6ecfd5 (diff) | |
download | latinime-d78a447d107ae60d2bb8f16a1b9797f5ebad2277.tar.gz latinime-d78a447d107ae60d2bb8f16a1b9797f5ebad2277.tar.xz latinime-d78a447d107ae60d2bb8f16a1b9797f5ebad2277.zip |
Add a dedicated method to control time in native code.
Bug: 12443085
Change-Id: I41a5cf6c895cb59e54af98b40efded36afcd3247
Diffstat (limited to 'native/jni/src')
-rw-r--r-- | native/jni/src/suggest/policyimpl/dictionary/structure/v4/ver4_patricia_trie_policy.cpp | 12 | ||||
-rw-r--r-- | native/jni/src/suggest/policyimpl/dictionary/structure/v4/ver4_patricia_trie_policy.h | 3 |
2 files changed, 0 insertions, 15 deletions
diff --git a/native/jni/src/suggest/policyimpl/dictionary/structure/v4/ver4_patricia_trie_policy.cpp b/native/jni/src/suggest/policyimpl/dictionary/structure/v4/ver4_patricia_trie_policy.cpp index 96bb8128e..448962ec2 100644 --- a/native/jni/src/suggest/policyimpl/dictionary/structure/v4/ver4_patricia_trie_policy.cpp +++ b/native/jni/src/suggest/policyimpl/dictionary/structure/v4/ver4_patricia_trie_policy.cpp @@ -34,11 +34,6 @@ const char *const Ver4PatriciaTriePolicy::UNIGRAM_COUNT_QUERY = "UNIGRAM_COUNT"; const char *const Ver4PatriciaTriePolicy::BIGRAM_COUNT_QUERY = "BIGRAM_COUNT"; const char *const Ver4PatriciaTriePolicy::MAX_UNIGRAM_COUNT_QUERY = "MAX_UNIGRAM_COUNT"; const char *const Ver4PatriciaTriePolicy::MAX_BIGRAM_COUNT_QUERY = "MAX_BIGRAM_COUNT"; -const char *const Ver4PatriciaTriePolicy::SET_CURRENT_TIME_FOR_TESTING_QUERY_FORMAT = - "SET_CURRENT_TIME_FOR_TESTING:%d"; -const char *const Ver4PatriciaTriePolicy::GET_CURRENT_TIME_QUERY = "GET_CURRENT_TIME"; -const char *const Ver4PatriciaTriePolicy::QUIT_TIMEKEEPER_TEST_MODE_QUERY = - "QUIT_TIMEKEEPER_TEST_MODE"; const int Ver4PatriciaTriePolicy::MARGIN_TO_REFUSE_DYNAMIC_OPERATIONS = 1024; const int Ver4PatriciaTriePolicy::MIN_DICT_SIZE_TO_REFUSE_DYNAMIC_OPERATIONS = Ver4DictConstants::MAX_DICTIONARY_SIZE - MARGIN_TO_REFUSE_DYNAMIC_OPERATIONS; @@ -288,7 +283,6 @@ bool Ver4PatriciaTriePolicy::needsToRunGC(const bool mindsBlockByGC) const { void Ver4PatriciaTriePolicy::getProperty(const char *const query, const int queryLength, char *const outResult, const int maxResultLength) { const int compareLength = queryLength + 1 /* terminator */; - int timestamp = NOT_A_TIMESTAMP; if (strncmp(query, UNIGRAM_COUNT_QUERY, compareLength) == 0) { snprintf(outResult, maxResultLength, "%d", mUnigramCount); } else if (strncmp(query, BIGRAM_COUNT_QUERY, compareLength) == 0) { @@ -301,12 +295,6 @@ void Ver4PatriciaTriePolicy::getProperty(const char *const query, const int quer snprintf(outResult, maxResultLength, "%d", mHeaderPolicy->isDecayingDict() ? ForgettingCurveUtils::MAX_BIGRAM_COUNT : static_cast<int>(Ver4DictConstants::MAX_DICTIONARY_SIZE)); - } else if (sscanf(query, SET_CURRENT_TIME_FOR_TESTING_QUERY_FORMAT, ×tamp) == 1) { - TimeKeeper::startTestModeWithForceCurrentTime(timestamp); - } else if (strncmp(query, GET_CURRENT_TIME_QUERY, compareLength) == 0) { - snprintf(outResult, maxResultLength, "%d", TimeKeeper::peekCurrentTime()); - } else if (strncmp(query, QUIT_TIMEKEEPER_TEST_MODE_QUERY, compareLength) == 0) { - TimeKeeper::stopTestMode(); } } diff --git a/native/jni/src/suggest/policyimpl/dictionary/structure/v4/ver4_patricia_trie_policy.h b/native/jni/src/suggest/policyimpl/dictionary/structure/v4/ver4_patricia_trie_policy.h index 8187b7a39..81aed20a3 100644 --- a/native/jni/src/suggest/policyimpl/dictionary/structure/v4/ver4_patricia_trie_policy.h +++ b/native/jni/src/suggest/policyimpl/dictionary/structure/v4/ver4_patricia_trie_policy.h @@ -116,9 +116,6 @@ class Ver4PatriciaTriePolicy : public DictionaryStructureWithBufferPolicy { static const char *const BIGRAM_COUNT_QUERY; static const char *const MAX_UNIGRAM_COUNT_QUERY; static const char *const MAX_BIGRAM_COUNT_QUERY; - static const char *const SET_CURRENT_TIME_FOR_TESTING_QUERY_FORMAT; - static const char *const GET_CURRENT_TIME_QUERY; - static const char *const QUIT_TIMEKEEPER_TEST_MODE_QUERY; // When the dictionary size is near the maximum size, we have to refuse dynamic operations to // prevent the dictionary from overflowing. static const int MARGIN_TO_REFUSE_DYNAMIC_OPERATIONS; |