• Tommy Li's avatar
    [omnibox] Refactor Autocomplete deduplication. Sort from best to worst. · bb92e3b6
    Tommy Li authored
    This CL makes AutocompleteMatch::duplicate_matches sorted from
    best-to-worst.
    
    It refactors the deduplication process by splitting the duplicate
    preference sorting code into a comparator, and puts the relevance
    upgrading logic into its own method in:
    AutocompleteMatch::UpgradeMatchWithPropertiesFrom().
    
    This CL is needed, because almost any re-duplication logic used for
    Entity Suggest "plain" match (see bug) will need to sort the duplicates
    from second-best to worst.
    
    But this should also be a pretty beneficial change on its own for code
    clarity.
    
    Bug: 989232
    Change-Id: I71f093fe69714ee491328a54e3e2238a3ecadbbc
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1730598
    Commit-Queue: Tommy Li <tommycli@chromium.org>
    Reviewed-by: default avatarmanuk hovanesian <manukh@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#686474}
    bb92e3b6
autocomplete_match.cc 39.6 KB