branch: externals/ivy-hydra
commit 93929ec776033484ea3f9a4dc5a2f668745392b6
Author: Basil L. Contovounesios <[email protected]>
Commit: Basil L. Contovounesios <[email protected]>
* ivy.el (ivy--shorter-matches-first): Simplify
---
ivy.el | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/ivy.el b/ivy.el
index eb271a1..68e8f58 100644
--- a/ivy.el
+++ b/ivy.el
@@ -3636,12 +3636,9 @@ CANDIDATES are assumed to be static."
(defun ivy--shorter-matches-first (_name cands)
"Sort CANDS according to their length."
- (if (< (length cands) ivy-sort-max-size)
- (cl-sort
- (copy-sequence cands)
- (lambda (s1 s2)
- (< (length s1) (length s2))))
- cands))
+ (if (nthcdr ivy-sort-max-size cands)
+ cands
+ (cl-sort (copy-sequence cands) #'< :key #'length)))
(defcustom ivy-sort-matches-functions-alist
'((t . nil)