branch: externals/vertico
commit 8734ab907382178c789dab956e372a72f008e132
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>

    Use pcase-dolist
---
 vertico.el | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/vertico.el b/vertico.el
index 6746500b80..09c37250f9 100644
--- a/vertico.el
+++ b/vertico.el
@@ -518,13 +518,12 @@ The function is configured by BY, BSIZE, BINDEX, BPRED 
and PRED."
                                      (min (+ index vertico-count) 
vertico--total))
               (funcall vertico--highlight-function)
               (vertico--affixate))))
-      (dolist (cand candidates)
-        (let ((str (car cand)))
-          (when-let (new-title (and group-fun (funcall group-fun str nil)))
-            (unless (equal title new-title)
-              (setq title new-title)
-              (push (vertico--format-group-title title str) lines))
-            (setcar cand (funcall group-fun str 'transform))))
+      (pcase-dolist ((and cand `(,str . ,_)) candidates)
+        (when-let (new-title (and group-fun (funcall group-fun str nil)))
+          (unless (equal title new-title)
+            (setq title new-title)
+            (push (vertico--format-group-title title str) lines))
+          (setcar cand (funcall group-fun str 'transform)))
         (when (= index vertico--index)
           (setq curr-line (length lines)))
         (push (cons index cand) lines)

Reply via email to