[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 6c858c1 168/399: ivy.el (ivy--filter): Improve performance
From: |
Oleh Krehel |
Subject: |
[elpa] master 6c858c1 168/399: ivy.el (ivy--filter): Improve performance with :matcher |
Date: |
Sat, 20 Jul 2019 14:57:16 -0400 (EDT) |
branch: master
commit 6c858c16b22a4699603bf077195127d16670ffdf
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy.el (ivy--filter): Improve performance with :matcher
First try if caching is possible. This assumes that e.g.
(funcall matcher "ab" candidates)
is a subset of
(funcall matcher "a" candidates)
---
ivy.el | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/ivy.el b/ivy.el
index 423c2ec..fe1b865 100644
--- a/ivy.el
+++ b/ivy.el
@@ -3077,8 +3077,6 @@ CANDIDATES are assumed to be static."
(matcher (ivy-state-matcher ivy-last))
(case-fold-search (ivy--case-fold-p name))
(cands (cond
- (matcher
- (funcall matcher re candidates))
((and ivy--old-re
(stringp re)
(stringp ivy--old-re)
@@ -3090,10 +3088,9 @@ CANDIDATES are assumed to be static."
ivy--old-re)
re)
'(0 2)))
- (ignore-errors
- (cl-remove-if-not
- (lambda (x) (string-match-p re x))
- ivy--old-cands)))
+ (ivy--re-filter re ivy--old-cands))
+ (matcher
+ (funcall matcher re candidates))
(t
(ivy--re-filter re candidates)))))
(if (memq (cdr (assq (ivy-state-caller ivy-last)
- [elpa] master 1e38ed4 146/399: counsel.el (counsel-minor): Add command to toggle minor mode, (continued)
- [elpa] master 1e38ed4 146/399: counsel.el (counsel-minor): Add command to toggle minor mode, Oleh Krehel, 2019/07/20
- [elpa] master 2098d27 148/399: swiper.el: Set up occur for swiper-isearch, Oleh Krehel, 2019/07/20
- [elpa] master dceecd8 155/399: swiper.el (swiper-occur): Adapt to swiper-isearch, Oleh Krehel, 2019/07/20
- [elpa] master f38bb51 161/399: ivy.el (ivy--prompt-selectable-p): Allow to select "", Oleh Krehel, 2019/07/20
- [elpa] master 1b13ee8 162/399: ivy.el (ivy--use-selectable-prompt): Cache ivy--prompt-selected-p, Oleh Krehel, 2019/07/20
- [elpa] master 92ec03c 163/399: ivy-test.el (ivy-use-selectable-prompt): Add tests, Oleh Krehel, 2019/07/20
- [elpa] master b2693d1 160/399: counsel.el (counsel-locate-db-path): New defcustom, Oleh Krehel, 2019/07/20
- [elpa] master 44ea8b5 166/399: counsel.el (counsel-git-grep-cmd-function): Add, Oleh Krehel, 2019/07/20
- [elpa] master 502eae6 159/399: counsel.el (counsel--call): Rename to counsel--command, Oleh Krehel, 2019/07/20
- [elpa] master 115efb7 170/399: ivy.el (ivy--sorted-files): Work around all-completions returning $$, Oleh Krehel, 2019/07/20
- [elpa] master 6c858c1 168/399: ivy.el (ivy--filter): Improve performance with :matcher,
Oleh Krehel <=
- [elpa] master ba849e5 173/399: ivy.el (ivy--re-filter): Fix for ivy--regex-ignore-order, Oleh Krehel, 2019/07/20
- [elpa] master 5458f93 169/399: ivy.el (ivy--filter): Avoid a filter on empty input, Oleh Krehel, 2019/07/20
- [elpa] master 9c53320 174/399: swiper.el (swiper-isearch-function): Fix for strings with trailing \|, Oleh Krehel, 2019/07/20
- [elpa] master ce0a1f1 172/399: ivy.el (ivy--filter): Fix matcher not called on input "", Oleh Krehel, 2019/07/20
- [elpa] master 39759cf 180/399: ivy-test.el (ivy-with): Save current buffer, Oleh Krehel, 2019/07/20
- [elpa] master fa87b97 182/399: ivy-test.el: Print version, Oleh Krehel, 2019/07/20
- [elpa] master 8482f62 179/399: swiper.el (swiper-isearch-function): Fix str is " ", Oleh Krehel, 2019/07/20
- [elpa] master 482088c 178/399: swiper.el (swiper--avy-candidates): Fix for swiper-background-faces, Oleh Krehel, 2019/07/20
- [elpa] master 0e62f0d 185/399: counsel.el (counsel-switch-buffer-other-window): Update prompt, Oleh Krehel, 2019/07/20
- [elpa] master 5115df3 184/399: counsel.el: counsel-switch-buffer-other-window: new command., Oleh Krehel, 2019/07/20