diff options
author | 2014-06-19 16:12:34 +0900 | |
---|---|---|
committer | 2014-06-23 22:58:46 +0900 | |
commit | fdebf4005f849a4a2875b686d239a817ca043842 (patch) | |
tree | 40a4728b0bd9d4fa199ca8f4b2fb0abb2fa869c2 /java/src/com/android/inputmethod/latin/Suggest.java | |
parent | e83e79cb055fbfe5171fb79a2224e7d9e2cda4d2 (diff) | |
download | latinime-fdebf4005f849a4a2875b686d239a817ca043842.tar.gz latinime-fdebf4005f849a4a2875b686d239a817ca043842.tar.xz latinime-fdebf4005f849a4a2875b686d239a817ca043842.zip |
[CS2] Refactor a bit removeDups
This way is more understandable, and also supporting an
external string is helping for future refactorings
Bug: 13238601
Change-Id: I4ebeed46eb0b35011164946af71ac257c6449ddb
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Suggest.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/Suggest.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index 7364fc979..575ec5c76 100644 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -180,6 +180,7 @@ public final class Suggest { suggestionsContainer.set(i, transformedWordInfo); } } + SuggestedWordInfo.removeDups(typedWord, suggestionsContainer); if (!TextUtils.isEmpty(typedWord)) { suggestionsContainer.add(0, new SuggestedWordInfo(typedWord, @@ -188,7 +189,6 @@ public final class Suggest { SuggestedWordInfo.NOT_AN_INDEX /* indexOfTouchPointOfSecondWord */, SuggestedWordInfo.NOT_A_CONFIDENCE /* autoCommitFirstWordConfidence */)); } - SuggestedWordInfo.removeDups(suggestionsContainer); final ArrayList<SuggestedWordInfo> suggestionsList; if (DBG && !suggestionsContainer.isEmpty()) { @@ -237,7 +237,7 @@ public final class Suggest { final SuggestedWordInfo rejected = suggestionsContainer.remove(0); suggestionsContainer.add(1, rejected); } - SuggestedWordInfo.removeDups(suggestionsContainer); + SuggestedWordInfo.removeDups(null /* typedWord */, suggestionsContainer); // For some reason some suggestions with MIN_VALUE are making their way here. // TODO: Find a more robust way to detect distractors. |