1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-24 06:20:43 -08:00

(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.
This commit is contained in:
Stefan Monnier 2024-06-08 17:34:30 -04:00
parent 15f515c7a3
commit e9a0256a55
2 changed files with 36 additions and 6 deletions

View file

@ -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)