Skip to content
Snippets Groups Projects
Commit 16e16153 authored by Keisuke Kuroyanagi's avatar Keisuke Kuroyanagi
Browse files

Fix: ProbabilityDictContent can be wrongly large.

It can be twice as large as it should be (80KB larger).

Change-Id: If94f748f8c48a442b3c95ac989099aaed2aa2f86
parent 46fcb3f9
No related branches found
No related tags found
No related merge requests found
...@@ -74,8 +74,8 @@ bool ProbabilityDictContent::setProbabilityEntry(const int terminalId, ...@@ -74,8 +74,8 @@ bool ProbabilityDictContent::setProbabilityEntry(const int terminalId,
return false; return false;
} }
writingPos += getEntrySize(); writingPos += getEntrySize();
mSize++;
} }
mSize = terminalId + 1;
} }
return writeEntry(probabilityEntry, entryPos); return writeEntry(probabilityEntry, entryPos);
} }
...@@ -100,7 +100,6 @@ bool ProbabilityDictContent::flushToFile(const char *const dictPath) const { ...@@ -100,7 +100,6 @@ bool ProbabilityDictContent::flushToFile(const char *const dictPath) const {
bool ProbabilityDictContent::runGC( bool ProbabilityDictContent::runGC(
const TerminalPositionLookupTable::TerminalIdMap *const terminalIdMap, const TerminalPositionLookupTable::TerminalIdMap *const terminalIdMap,
const ProbabilityDictContent *const originalProbabilityDictContent) { const ProbabilityDictContent *const originalProbabilityDictContent) {
mSize = 0;
for (TerminalPositionLookupTable::TerminalIdMap::const_iterator it = terminalIdMap->begin(); for (TerminalPositionLookupTable::TerminalIdMap::const_iterator it = terminalIdMap->begin();
it != terminalIdMap->end(); ++it) { it != terminalIdMap->end(); ++it) {
const ProbabilityEntry probabilityEntry = const ProbabilityEntry probabilityEntry =
...@@ -109,7 +108,6 @@ bool ProbabilityDictContent::runGC( ...@@ -109,7 +108,6 @@ bool ProbabilityDictContent::runGC(
AKLOGE("Cannot set probability entry in runGC. terminalId: %d", it->second); AKLOGE("Cannot set probability entry in runGC. terminalId: %d", it->second);
return false; return false;
} }
mSize++;
} }
return true; return true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment