aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-07-10 20:16:13 +0900
committerJean Chalard <jchalard@google.com>2013-07-24 18:40:14 +0900
commit25de86a6a26232964937872f203f065dd9f9faa4 (patch)
tree563e0a03ef619f4e97297ed52884e2e5b6c33cdc /java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java
parent9d313c6ce96bbf47db7651445031793765094d7e (diff)
downloadlatinime-25de86a6a26232964937872f203f065dd9f9faa4.tar.gz
latinime-25de86a6a26232964937872f203f065dd9f9faa4.tar.xz
latinime-25de86a6a26232964937872f203f065dd9f9faa4.zip
[FD4] Separate cached address before/after update for groups
This should fix bug#8526576 for good. Bug: 8526576 Change-Id: I473aad26b69d64efa09d2ec9d8e69f29f5cf4819
Diffstat (limited to 'java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java')
-rw-r--r--java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java b/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java
index 5530b7a74..1132e4a4a 100644
--- a/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java
+++ b/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java
@@ -111,9 +111,15 @@ public final class FusionDictionary implements Iterable<Word> {
Node mChildren;
boolean mIsNotAWord; // Only a shortcut
boolean mIsBlacklistEntry;
- // The two following members to help with binary generation
- int mCachedSize;
- int mCachedAddress;
+ // mCachedSize and mCachedAddressBefore/AfterUpdate are helpers for binary dictionary
+ // generation. Before and After always hold the same value except during dictionary
+ // address compression, where the update process needs to know about both values at the
+ // same time. Updating will update the AfterUpdate value, and the code will move them
+ // to BeforeUpdate before the next update pass.
+ // The update process does not need two versions of mCachedSize.
+ int mCachedSize; // The size, in bytes, of this char group.
+ int mCachedAddressBeforeUpdate; // The address of this char group (before update)
+ int mCachedAddressAfterUpdate; // The address of this char group (after update)
public CharGroup(final int[] chars, final ArrayList<WeightedString> shortcutTargets,
final ArrayList<WeightedString> bigrams, final int frequency,