summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2021-11-04 20:33:18 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2021-11-04 20:33:18 +0100
commit6647b7fc3dfdbc4b23740b3aea6c284576a82723 (patch)
treea7c14f6c2aba567ba15510d42beebc456fc49f42
parentbf024f2c5fd4b46bd03621b468bf941dc5fc8204 (diff)
Minor optimization
-rw-r--r--corfu.el13
1 files 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)))))