summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2024-07-10 11:17:54 +0200
committerDaniel Mendler <mail@daniel-mendler.de>2024-07-10 11:18:39 +0200
commit2cd4bba3c746a91670a1d356531e27b77a21d058 (patch)
tree8257a59f70e96c1adcab95956b22c5bd901dcb15
parentb7099b4b714178da1d656b346f55b1742a55fd98 (diff)
Minor cleanup, reduce allocations
-rw-r--r--corfu.el7
1 files changed, 3 insertions, 4 deletions
diff --git a/corfu.el b/corfu.el
index 3993ddb..6fd0cb2 100644
--- a/corfu.el
+++ b/corfu.el
@@ -723,10 +723,9 @@ FRAME is the existing frame."
(defun corfu--format-candidates (cands)
"Format annotated CANDS."
- (setq cands
- (cl-loop for c in cands collect
- (cl-loop for s in c collect
- (replace-regexp-in-string "[ \t]*\n[ \t]*" " " s))))
+ (cl-loop for c in cands do
+ (cl-loop for s in-ref c do
+ (setf s (replace-regexp-in-string "[ \t]*\n[ \t]*" " " s))))
(let* ((cw (cl-loop for x in cands maximize (string-width (car x))))
(pw (cl-loop for x in cands maximize (string-width (cadr x))))
(sw (cl-loop for x in cands maximize (string-width (caddr x))))