diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2024-06-08 17:34:30 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2024-06-08 17:34:56 -0400 |
commit | e9a0256a556622474bcbb015f88d790666db2cc9 (patch) | |
tree | 614c7612fe09bf0f5de1231ca6741213d31b8f3b /test/lisp/emacs-lisp | |
parent | 15f515c7a37f29117ff123821265a760ff0d040d (diff) | |
download | emacs-e9a0256a556622474bcbb015f88d790666db2cc9.tar.gz emacs-e9a0256a556622474bcbb015f88d790666db2cc9.tar.bz2 emacs-e9a0256a556622474bcbb015f88d790666db2cc9.zip |
(pcase--app-subst-match): Try and fix performance regression (bug#71398)
* lisp/emacs-lisp/pcase.el (pcase--app-subst-match): Optimize matches
against (quote VAL).
* test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-quote-optimization):
Add new test case.
Diffstat (limited to 'test/lisp/emacs-lisp')
-rw-r--r-- | test/lisp/emacs-lisp/pcase-tests.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/lisp/emacs-lisp/pcase-tests.el b/test/lisp/emacs-lisp/pcase-tests.el index 35cf2f93cdc..e777b71920c 100644 --- a/test/lisp/emacs-lisp/pcase-tests.el +++ b/test/lisp/emacs-lisp/pcase-tests.el @@ -83,7 +83,14 @@ (should-not (pcase-tests-grep 'FOO (macroexpand '(pcase EXP (`(,_ . ,_) (BAR)) - ('(a b) (FOO))))))) + ('(a b) (FOO)))))) + (let ((exp1 (macroexpand '(pcase EXP + (`(`(,(or 'a1 'b1)) (FOO1))) + ('(c) (FOO2)) + ('(d) (FOO3)))))) + (should (= 1 (with-temp-buffer (prin1 exp1 (current-buffer)) + (goto-char (point-min)) + (count-matches "(FOO3)")))))) (ert-deftest pcase-tests-bug14773 () (let ((f (lambda (x) |