]> git.eshelyaron.com Git - emacs.git/commit
(pcase-mutually-exclusive): Use auto-generated table
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 28 Mar 2024 04:06:00 +0000 (00:06 -0400)
committerEshel Yaron <me@eshelyaron.com>
Thu, 28 Mar 2024 10:28:46 +0000 (11:28 +0100)
commit236a519f36df7042478d547f72f1ea18771d4314
tree7579f942f0ae3879c6601067cf3641136466e18c
parent1e2d020c63a773c7123b3754db4e13be367d4188
(pcase-mutually-exclusive): Use auto-generated table

The `pcase-mutually-exclusive-predicates` table was not very
efficient since it grew like O(N²) with the number of
predicates.  Replace it with an O(N) table that's auto-generated
from the `built-in-class` objects.

* lisp/emacs-lisp/pcase.el (pcase-mutually-exclusive-predicates):
Delete variable.
(pcase--subtype-bitsets): New function and constant.
(pcase--mutually-exclusive-p): Use them.
* lisp/emacs-lisp/cl-preloaded.el (built-in-class): Don't inline.

(cherry picked from commit f1fe13ea057237f5426c93876488cb95be86156c)
lisp/emacs-lisp/cl-preloaded.el
lisp/emacs-lisp/pcase.el
test/lisp/emacs-lisp/pcase-tests.el