Optimization.

We already had that computed

Change-Id: I2a9742eaee2e9db1f73aeddda7bae7e237b4d15c
main
Jean Chalard 2012-06-26 20:02:07 +09:00
parent ec8b27fe49
commit 22657dcba0
1 changed files with 2 additions and 2 deletions

View File

@ -413,11 +413,11 @@ public class Suggest {
// Check the last one's score and bail // Check the last one's score and bail
if (suggestions.size() >= prefMaxSuggestions if (suggestions.size() >= prefMaxSuggestions
&& suggestions.get(prefMaxSuggestions - 1).mScore >= score) return true; && suggestions.get(prefMaxSuggestions - 1).mScore >= score) return true;
final int length = Character.codePointCount(word, 0, word.length()); final int length = wordInfo.mCodePointCount;
while (pos < suggestions.size()) { while (pos < suggestions.size()) {
final int curScore = suggestions.get(pos).mScore; final int curScore = suggestions.get(pos).mScore;
if (curScore < score if (curScore < score
|| (curScore == score && length < suggestions.get(pos).codePointCount())) { || (curScore == score && length < suggestions.get(pos).mCodePointCount)) {
break; break;
} }
pos++; pos++;