aboutsummaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
Diffstat (limited to 'native')
-rw-r--r--native/jni/src/suggest/policyimpl/dictionary/structure/backward/v402/content/probability_dict_content.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/native/jni/src/suggest/policyimpl/dictionary/structure/backward/v402/content/probability_dict_content.cpp b/native/jni/src/suggest/policyimpl/dictionary/structure/backward/v402/content/probability_dict_content.cpp
index 4a740d47b..ef6166ffd 100644
--- a/native/jni/src/suggest/policyimpl/dictionary/structure/backward/v402/content/probability_dict_content.cpp
+++ b/native/jni/src/suggest/policyimpl/dictionary/structure/backward/v402/content/probability_dict_content.cpp
@@ -74,8 +74,8 @@ bool ProbabilityDictContent::setProbabilityEntry(const int terminalId,
return false;
}
writingPos += getEntrySize();
- mSize++;
}
+ mSize = terminalId + 1;
}
return writeEntry(probabilityEntry, entryPos);
}
@@ -100,7 +100,6 @@ bool ProbabilityDictContent::flushToFile(const char *const dictPath) const {
bool ProbabilityDictContent::runGC(
const TerminalPositionLookupTable::TerminalIdMap *const terminalIdMap,
const ProbabilityDictContent *const originalProbabilityDictContent) {
- mSize = 0;
for (TerminalPositionLookupTable::TerminalIdMap::const_iterator it = terminalIdMap->begin();
it != terminalIdMap->end(); ++it) {
const ProbabilityEntry probabilityEntry =
@@ -109,7 +108,6 @@ bool ProbabilityDictContent::runGC(
AKLOGE("Cannot set probability entry in runGC. terminalId: %d", it->second);
return false;
}
- mSize++;
}
return true;
}