Function: xref--sort-hits
xref--sort-hits is a byte-compiled function defined in xref.el.gz.
Signature
(xref--sort-hits HITS)
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/xref.el.gz
(defun xref--sort-hits (hits)
;; By default, ripgrep's output order is non-deterministic
;; (https://github.com/BurntSushi/ripgrep/issues/152)
;; because it does the search in parallel.
;; Grep's output also comes out in seemingly arbitrary order,
;; though stable one. Let's sort both for better UI.
(sort hits
(lambda (h1 h2)
(string< (cadr h1) (cadr h2)))))