aboutsummaryrefslogtreecommitdiffstats
path: root/native/jni/src
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2018-12-11 16:36:28 -0800
committerandroid-build-merger <android-build-merger@google.com>2018-12-11 16:36:28 -0800
commitf7b80bb317e7be97a02975b54388d7f52c22c25c (patch)
tree5780814a1a2cc7176baef038d972738420a3bf23 /native/jni/src
parentfd6a4b36d195d8fc980d161cca2a0fc0ccba3cf6 (diff)
parent535cd61e636abbda6014ab0f48f65b264114dcac (diff)
downloadlatinime-f7b80bb317e7be97a02975b54388d7f52c22c25c.tar.gz
latinime-f7b80bb317e7be97a02975b54388d7f52c22c25c.tar.xz
latinime-f7b80bb317e7be97a02975b54388d7f52c22c25c.zip
Merge "Fix performance-for-range-copy warnings" am: db2e4888f8 am: 947f8ee063
am: 535cd61e63 Change-Id: Ic8ee8523a644b283ef0c9592bb66bf09ca541485
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);