branch: master commit d9c4427330d47b38199082796f8a522d56d10d1c Author: Oleh Krehel <ohwoeo...@gmail.com> Commit: Oleh Krehel <ohwoeo...@gmail.com>
Improve performance for "^" initial input ivy.el (ivy--filter): There's no need to anchor when the previous regex is "^" (matches everything). The result will be index 0 anyway, but without this optimization it can be slow for ~30k candidates. --- ivy.el | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ivy.el b/ivy.el index 07b84c3..58d57ea 100644 --- a/ivy.el +++ b/ivy.el @@ -1242,7 +1242,7 @@ CANDIDATES are assumed to be static." res)))) (tail (nthcdr ivy--index ivy--old-cands)) idx) - (when (and tail ivy--old-cands) + (when (and tail ivy--old-cands (not (equal "^" ivy--old-re))) (unless (and (not (equal re ivy--old-re)) (or (setq ivy--index (or