Skip to content

Search backend: use sort interface of `result.Matches`

Warren Gifford requested to merge backend-dry-run/cc/deduplicate-sort into main

Created by: camdencheek

We have a built-in sorting mechanism for the result.Matches type, and it was almost equivalent to that of sortResults. This brings the two into agreement and removes sortResults in favor of the sorting interface implemented by result.Matches.

To do this, I needed to:

  • Remove exactFilePatterns logic. This was already unused since exactFilePatterns was always being passed as nil.
  • Add AuthorDate to the Key type and modified the Less() method to use it for sorting. Previously, we were sorting by CommitID, but this is not a very useful sort for commit results.
  • Convert a few uses of []result.Match to result.Matches so we can use the sort interface it implements

Merge request reports

Loading