diff options
author | Andrea Corallo <acorallo@gnu.org> | 2024-02-15 16:13:16 +0100 |
---|---|---|
committer | Andrea Corallo <acorallo@gnu.org> | 2024-02-15 16:48:36 +0100 |
commit | aa849984896ce393afe92dd4fb7fbce494e131a4 (patch) | |
tree | f5c205b4ffe5ce32c0ba071d4c65e4fa69788163 /lisp/emacs-lisp/comp-cstr.el | |
parent | 74f060230f70ba986a1c78e4e0d1181492567597 (diff) | |
download | emacs-aa849984896ce393afe92dd4fb7fbce494e131a4.tar.gz emacs-aa849984896ce393afe92dd4fb7fbce494e131a4.tar.bz2 emacs-aa849984896ce393afe92dd4fb7fbce494e131a4.zip |
* make use of 'cl--direct-supertypes-of-type' in the native-compiler
* lisp/emacs-lisp/comp-cstr.el (comp--direct-supertypes): Use
cl--direct-supertypes-of-type.
Diffstat (limited to 'lisp/emacs-lisp/comp-cstr.el')
-rw-r--r-- | lisp/emacs-lisp/comp-cstr.el | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el index 2984bedb1dd..0a8b3b7efb2 100644 --- a/lisp/emacs-lisp/comp-cstr.el +++ b/lisp/emacs-lisp/comp-cstr.el @@ -270,18 +270,19 @@ Return them as multiple value." (symbol-name y))) (defun comp--direct-supertypes (type) - "Return the direct supertypes of TYPE." - (let ((supers (comp-supertypes type))) - (cl-assert (eq type (car supers))) - (cl-loop - with notdirect = nil - with direct = nil - for parent in (cdr supers) - unless (memq parent notdirect) - do (progn - (push parent direct) - (setq notdirect (append notdirect (comp-supertypes parent)))) - finally return direct))) + (or + (gethash type cl--direct-supertypes-of-type) + (let ((supers (comp-supertypes type))) + (cl-assert (eq type (car supers))) + (cl-loop + with notdirect = nil + with direct = nil + for parent in (cdr supers) + unless (memq parent notdirect) + do (progn + (push parent direct) + (setq notdirect (append notdirect (comp-supertypes parent)))) + finally return direct)))) (defsubst comp-subtype-p (type1 type2) "Return t if TYPE1 is a subtype of TYPE2 or nil otherwise." |