mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Fix: ProbabilityDictContent can be wrongly large.
It can be twice as large as it should be (80KB larger). Change-Id: If94f748f8c48a442b3c95ac989099aaed2aa2f86
This commit is contained in:
parent
46fcb3f91f
commit
16e1615301
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user