aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/SuggestedWords.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-06-24 18:26:51 +0900
committerJean Chalard <jchalard@google.com>2014-06-24 18:26:51 +0900
commitc82257ba6e8a13249f573edd867c5d2808db8d64 (patch)
tree2c1611a0a93de59c6278c935fb4af433754bb78c /java/src/com/android/inputmethod/latin/SuggestedWords.java
parentd700e5970049deee7f61aeb573ef42d7caa6ab0f (diff)
downloadlatinime-c82257ba6e8a13249f573edd867c5d2808db8d64.tar.gz
latinime-c82257ba6e8a13249f573edd867c5d2808db8d64.tar.xz
latinime-c82257ba6e8a13249f573edd867c5d2808db8d64.zip
[CS3.5] Small correction
Bug: 13238601 Change-Id: I7bd82a4678d8bf88f16bf271f20be8d37f9b97d7
Diffstat (limited to 'java/src/com/android/inputmethod/latin/SuggestedWords.java')
-rw-r--r--java/src/com/android/inputmethod/latin/SuggestedWords.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/SuggestedWords.java b/java/src/com/android/inputmethod/latin/SuggestedWords.java
index 8e78e970f..f22af7991 100644
--- a/java/src/com/android/inputmethod/latin/SuggestedWords.java
+++ b/java/src/com/android/inputmethod/latin/SuggestedWords.java
@@ -336,16 +336,17 @@ public class SuggestedWords {
return;
}
if (!TextUtils.isEmpty(typedWord)) {
- removeSuggestedWordInfoFrom(typedWord, candidates, 0);
+ removeSuggestedWordInfoFrom(typedWord, candidates, -1 /* startIndexExclusive */);
}
for (int i = 0; i < candidates.size(); ++i) {
- removeSuggestedWordInfoFrom(candidates.get(i).mWord, candidates, i);
+ removeSuggestedWordInfoFrom(candidates.get(i).mWord, candidates,
+ i /* startIndexExclusive */);
}
}
private static void removeSuggestedWordInfoFrom(final String word,
- final ArrayList<SuggestedWordInfo> candidates, final int startIndex) {
- for (int i = startIndex + 1; i < candidates.size(); ++i) {
+ final ArrayList<SuggestedWordInfo> candidates, final int startIndexExclusive) {
+ for (int i = startIndexExclusive + 1; i < candidates.size(); ++i) {
final SuggestedWordInfo previous = candidates.get(i);
if (word.equals(previous.mWord)) {
candidates.remove(i);