aboutsummaryrefslogtreecommitdiffstats
path: root/native/jni/src
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2018-12-11 16:20:39 -0800
committerandroid-build-merger <android-build-merger@google.com>2018-12-11 16:20:39 -0800
commit535cd61e636abbda6014ab0f48f65b264114dcac (patch)
tree7fe905ed76e2d644cec292b875a2bae6cb39eae3 /native/jni/src
parent6c06f060794cc6e9d7ccf0a4e35a60adfe479da1 (diff)
parent947f8ee063d8fa476080e61ef3e598f4f656d379 (diff)
downloadlatinime-535cd61e636abbda6014ab0f48f65b264114dcac.tar.gz
latinime-535cd61e636abbda6014ab0f48f65b264114dcac.tar.xz
latinime-535cd61e636abbda6014ab0f48f65b264114dcac.zip
Merge "Fix performance-for-range-copy warnings" am: db2e4888f8
am: 947f8ee063 Change-Id: I153c9732d7fd1733f196b9807d99cfe59fcde012
Diffstat (limited to 'native/jni/src')
-rw-r--r--native/jni/src/dictionary/structure/v4/ver4_patricia_trie_policy.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/native/jni/src/dictionary/structure/v4/ver4_patricia_trie_policy.cpp b/native/jni/src/dictionary/structure/v4/ver4_patricia_trie_policy.cpp
index 1dbec5545..6f96a5a0b 100644
--- a/native/jni/src/dictionary/structure/v4/ver4_patricia_trie_policy.cpp
+++ b/native/jni/src/dictionary/structure/v4/ver4_patricia_trie_policy.cpp
@@ -141,7 +141,7 @@ void Ver4PatriciaTriePolicy::iterateNgramEntries(const WordIdArrayView prevWordI
}
const auto languageModelDictContent = mBuffers->getLanguageModelDictContent();
for (size_t i = 1; i <= prevWordIds.size(); ++i) {
- for (const auto entry : languageModelDictContent->getProbabilityEntries(
+ for (const auto& entry : languageModelDictContent->getProbabilityEntries(
prevWordIds.limit(i))) {
const ProbabilityEntry &probabilityEntry = entry.getProbabilityEntry();
if (!probabilityEntry.isValid()) {
@@ -516,7 +516,7 @@ const WordProperty Ver4PatriciaTriePolicy::getWordProperty(
int ngramPrevWordsCodePoints[MAX_PREV_WORD_COUNT_FOR_N_GRAM][MAX_WORD_LENGTH];
int ngramPrevWordsCodePointCount[MAX_PREV_WORD_COUNT_FOR_N_GRAM];
bool ngramPrevWordIsBeginningOfSentense[MAX_PREV_WORD_COUNT_FOR_N_GRAM];
- for (const auto entry : languageModelDictContent->exportAllNgramEntriesRelatedToWord(
+ for (const auto& entry : languageModelDictContent->exportAllNgramEntriesRelatedToWord(
mHeaderPolicy, wordId)) {
const int codePointCount = getCodePointsAndReturnCodePointCount(entry.getTargetWordId(),
MAX_WORD_LENGTH, ngramTargetCodePoints);