emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/corfu 6647b7f 2/2: Minor optimization


From: ELPA Syncer
Subject: [elpa] externals/corfu 6647b7f 2/2: Minor optimization
Date: Thu, 4 Nov 2021 15:57:12 -0400 (EDT)

branch: externals/corfu
commit 6647b7fc3dfdbc4b23740b3aea6c284576a82723
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Minor optimization
---
 corfu.el | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/corfu.el b/corfu.el
index 7bf8214..c731f41 100644
--- a/corfu.el
+++ b/corfu.el
@@ -556,11 +556,10 @@ completion began less than that number of seconds ago."
 (defun corfu--match-symbol-p (pattern sym)
   "Return non-nil if SYM is matching an element of the PATTERN list."
   (and (symbolp sym)
-       (seq-some (lambda (x)
-                   (if (symbolp x)
-                       (eq sym x)
-                     (string-match-p x (symbol-name sym))))
-                 pattern)))
+       (cl-loop for x in pattern
+                thereis (if (symbolp x)
+                            (eq sym x)
+                          (string-match-p x (symbol-name sym))))))
 
 (defun corfu-quit ()
   "Quit Corfu completion."
@@ -954,8 +953,8 @@ completion began less than that number of seconds ago."
     (cancel-timer corfu--auto-timer)
     (setq corfu--auto-timer nil))
   (when (and (not completion-in-region-mode)
-             (display-graphic-p)
-             (corfu--match-symbol-p corfu-auto-commands this-command))
+             (corfu--match-symbol-p corfu-auto-commands this-command)
+             (display-graphic-p))
     (setq corfu--auto-timer (run-with-idle-timer corfu-auto-delay nil
                                                  #'corfu--auto-complete
                                                  (current-buffer)))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]