aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-07-24 20:04:57 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-07-24 20:04:57 -0700
commitea24dac97dc3bfe9401306273945a3196ecf4ff5 (patch)
tree82adb526fad0f5474df7334e2bce140e0c9053cd /java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java
parent808f6757c2defc157da64395dbd572073d83988f (diff)
parent289df0ecadb5b6320d8e1f484bf9decc1b726e53 (diff)
downloadlatinime-ea24dac97dc3bfe9401306273945a3196ecf4ff5.tar.gz
latinime-ea24dac97dc3bfe9401306273945a3196ecf4ff5.tar.xz
latinime-ea24dac97dc3bfe9401306273945a3196ecf4ff5.zip
am 289df0ec: Merge "[FD4] Separate cached address before/after update for groups"
* commit '289df0ecadb5b6320d8e1f484bf9decc1b726e53': [FD4] Separate cached address before/after update for groups
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,