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

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

[elpa] externals/capf-autosuggest 56796e2 23/63: Minor loop optimization


From: ELPA Syncer
Subject: [elpa] externals/capf-autosuggest 56796e2 23/63: Minor loop optimization
Date: Wed, 27 Oct 2021 14:57:57 -0400 (EDT)

branch: externals/capf-autosuggest
commit 56796e26ca634b9d68bf9e98f0f948fb139f4e81
Author: jakanakaevangeli <jakanakaevangeli@chiru.no>
Commit: jakanakaevangeli <jakanakaevangeli@chiru.no>

    Minor loop optimization
---
 history-capf.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/history-capf.el b/history-capf.el
index f86a299..9312ff0 100644
--- a/history-capf.el
+++ b/history-capf.el
@@ -83,13 +83,14 @@ Is only applicable if point is after the last prompt."
         ((eq action t)
          (cl-loop
           with only-one = capf-autosuggest-all-completions-only-one
+          with regexps = completion-regexp-list
           for i below (ring-size ring)
           for elem = (ring-ref ring i)
           if (string-prefix-p input elem)
+          if (cl-loop for regex in regexps
+                      always (string-match-p regex elem))
           if (or (null predicate)
                  (funcall predicate elem))
-          if (cl-loop for regex in completion-regexp-list
-                      always (string-match-p regex elem))
           if only-one
           return (list elem)
           else collect elem))



reply via email to

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