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 19:23:03 +0900
committerJean Chalard <jchalard@google.com>2013-07-23 17:52:54 +0900
commit91cbe3566d21e1ae11c1409ae62c0c0a9614dec6 (patch)
treeb63f42f5b136fb09e6fad87b669d1a252c36901f /java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java
parent62f3b4e9c9d896d2026ebf363aeefce36116baac (diff)
downloadlatinime-91cbe3566d21e1ae11c1409ae62c0c0a9614dec6.tar.gz
latinime-91cbe3566d21e1ae11c1409ae62c0c0a9614dec6.tar.xz
latinime-91cbe3566d21e1ae11c1409ae62c0c0a9614dec6.zip
[FD2] Separate cached address before/after update for nodes.
Bug: 8526576 Change-Id: Ib9f8594a9e12dc75eba296faff2612c4bd7483d3
Diffstat (limited to 'java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java')
-rw-r--r--java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java b/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java
index 17d281518..5530b7a74 100644
--- a/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java
+++ b/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java
@@ -46,7 +46,13 @@ public final class FusionDictionary implements Iterable<Word> {
ArrayList<CharGroup> mData;
// To help with binary generation
int mCachedSize = Integer.MIN_VALUE;
- int mCachedAddress = Integer.MIN_VALUE;
+ // mCachedAddressBefore/AfterUpdate are helpers for binary dictionary generation. They
+ // always hold the same value except between dictionary address compression, during which
+ // 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.
+ int mCachedAddressBeforeUpdate = Integer.MIN_VALUE;
+ int mCachedAddressAfterUpdate = Integer.MIN_VALUE;
int mCachedParentAddress = 0;
public Node() {