]> git.eshelyaron.com Git - emacs.git/commit
(cl-types-of): Speed up by caching more of its work
authorDavid Ponce <da_vid@orange.fr>
Tue, 29 Apr 2025 14:48:37 +0000 (10:48 -0400)
committerEshel Yaron <me@eshelyaron.com>
Sat, 10 May 2025 06:51:50 +0000 (08:51 +0200)
commit854fd9d31a626e22575d562e19dd0652815f2763
tree3e8d15c7b248a272515dc14c47acdd3fd2264e1d
parent3438c58a80bb2d60be94429b3180c96d8db6b227
(cl-types-of): Speed up by caching more of its work

* lisp/emacs-lisp/cl-types.el (cl--type-parents): Make it a proper function.
(cl--type-children): Use `cl--class-children` and make it a `defsubst`.
(cl--type-dag): η-reduce and make it a `defsubst`.
(cl--type-undefine): Also reset `cl--type-error`.
(cl--type-deftype): Modify `cl--type-list` atomically so we never need
to restore it upon error.  Don't test bogus parent here.
(cl-deftype2): Test bogus parent here instead.  Also, better preserve
the declarations for the lambda.
(cl-types-of): Do less uncached work.

(cherry picked from commit 4323ff209f2f73ca4e6d389de69eb310988c0b1f)
lisp/emacs-lisp/cl-types.el