Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ef01c51 authored by Jean Chalard's avatar Jean Chalard Committed by Android (Google) Code Review
Browse files

Merge "Remove some special casing"

parents a3f5f51e 7e49a2b6
Loading
Loading
Loading
Loading
+10 −27
Original line number Original line Diff line number Diff line
@@ -394,22 +394,6 @@ public class Suggest {
        final int score = wordInfo.mScore;
        final int score = wordInfo.mScore;
        int pos = 0;
        int pos = 0;


        // Check if it's the same word, only caps are different
        if (StringUtils.equalsIgnoreCase(consideredWord, word)) {
            // TODO: remove this surrounding if clause and move this logic to
            // getSuggestedWordBuilder.
            if (suggestions.size() > 0) {
                final SuggestedWordInfo currentHighestWord = suggestions.get(0);
                // If the current highest word is also equal to typed word, we need to compare
                // frequency to determine the insertion position. This does not ensure strictly
                // correct ordering, but ensures the top score is on top which is enough for
                // removing duplicates correctly.
                if (StringUtils.equalsIgnoreCase(currentHighestWord.mWord, word)
                        && score <= currentHighestWord.mScore) {
                    pos = 1;
                }
            }
        } else {
        // 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;
@@ -422,7 +406,6 @@ public class Suggest {
            }
            }
            pos++;
            pos++;
        }
        }
        }
        if (pos >= prefMaxSuggestions) {
        if (pos >= prefMaxSuggestions) {
            return true;
            return true;
        }
        }