* lisp/emacs-lisp/pcase.el (pcase--u1): Verify if self-quoting values can be
checked with memq. Fixes: debbugs:14935
This commit is contained in:
parent
ac93e56b69
commit
249eea30ee
2 changed files with 12 additions and 5 deletions
|
@ -659,11 +659,15 @@ Otherwise, it defers to REST which is a list of branches of the form
|
|||
(memq-fine t))
|
||||
(when all
|
||||
(dolist (alt (cdr upat))
|
||||
(unless (or (pcase--self-quoting-p alt)
|
||||
(and (eq (car-safe alt) '\`)
|
||||
(or (symbolp (cadr alt)) (integerp (cadr alt))
|
||||
(setq memq-fine nil)
|
||||
(stringp (cadr alt)))))
|
||||
(unless (if (pcase--self-quoting-p alt)
|
||||
(progn
|
||||
(unless (or (symbolp alt) (integerp alt))
|
||||
(setq memq-fine nil))
|
||||
t)
|
||||
(and (eq (car-safe alt) '\`)
|
||||
(or (symbolp (cadr alt)) (integerp (cadr alt))
|
||||
(setq memq-fine nil)
|
||||
(stringp (cadr alt)))))
|
||||
(setq all nil))))
|
||||
(if all
|
||||
;; Use memq for (or `a `b `c `d) rather than a big tree.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue