diff options
author | 2012-02-06 01:47:13 -0800 | |
---|---|---|
committer | 2012-02-06 01:47:13 -0800 | |
commit | ddbaddb00d19c885c2fb6d1254757cfd715b3bf5 (patch) | |
tree | 8259adc429321b70aa500f609963c6468507e880 /java/src/com/android/inputmethod/latin/WordComposer.java | |
parent | ed348a48460a56047d045d5e2356c1b1286388b1 (diff) | |
parent | a7f2500001c53dc5a6de9c2525a75229cc7c6645 (diff) | |
download | latinime-ddbaddb00d19c885c2fb6d1254757cfd715b3bf5.tar.gz latinime-ddbaddb00d19c885c2fb6d1254757cfd715b3bf5.tar.xz latinime-ddbaddb00d19c885c2fb6d1254757cfd715b3bf5.zip |
am a7f25000: Fix a bug with common objects.
* commit 'a7f2500001c53dc5a6de9c2525a75229cc7c6645':
Fix a bug with common objects.
Diffstat (limited to 'java/src/com/android/inputmethod/latin/WordComposer.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/WordComposer.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java index dd24432f7..f418968b5 100644 --- a/java/src/com/android/inputmethod/latin/WordComposer.java +++ b/java/src/com/android/inputmethod/latin/WordComposer.java @@ -310,13 +310,18 @@ public class WordComposer { // LastComposedWord#didAutoCorrectToAnotherWord with #equals(). It would be marginally // cleaner to do it here, but it would be slower (since we would #equals() for each commit, // instead of only on cancel), and ultimately we want to figure it out even earlier anyway. - final LastComposedWord lastComposedWord = new LastComposedWord(mCodes, - mXCoordinates, mYCoordinates, mTypedWord.toString(), + final ArrayList<int[]> codes = mCodes; + final int[] xCoordinates = mXCoordinates; + final int[] yCoordinates = mYCoordinates; + mCodes = new ArrayList<int[]>(N); + mXCoordinates = new int[N]; + mYCoordinates = new int[N]; + final LastComposedWord lastComposedWord = new LastComposedWord(codes, + xCoordinates, yCoordinates, mTypedWord.toString(), null == mAutoCorrection ? null : mAutoCorrection.toString()); if (type != LastComposedWord.COMMIT_TYPE_DECIDED_WORD) { lastComposedWord.deactivate(); } - mCodes.clear(); mTypedWord.setLength(0); mAutoCorrection = null; return lastComposedWord; |