branch: externals/ivy
commit 36c9245dd360628a3789515a89a1cdce9ddb8959
Author: Basil L. Contovounesios <[email protected]>
Commit: Basil L. Contovounesios <[email protected]>

    * ivy.el (ivy--format-function-generic): Refactor.
    
    Prefer eql over eq for arbitrary integers.
---
 ivy.el | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/ivy.el b/ivy.el
index cba2296430..b614dcb499 100644
--- a/ivy.el
+++ b/ivy.el
@@ -4130,15 +4130,13 @@ N wraps around, but skips the first element of the 
list."
 SELECTED-FN is called for the selected candidate, OTHER-FN for the others.
 Both functions take one string argument each.  CANDS is a list of candidates
 and SEPARATOR is used to join them."
-  (let ((i -1))
-    (mapconcat
-     (lambda (str)
-       (let ((curr (eq (cl-incf i) ivy--window-index)))
-         (if curr
-             (funcall selected-fn str)
-           (funcall other-fn str))))
-     cands
-     separator)))
+  (mapconcat (let ((i -1))
+               (lambda (str)
+                 (funcall (if (eql (cl-incf i) ivy--window-index)
+                              selected-fn
+                            other-fn)
+                          str)))
+             cands separator))
 
 (defun ivy-format-function-default (cands)
   "Transform CANDS into a multiline string for the minibuffer.

Reply via email to