From: Mattias EngdegÄrd Date: Mon, 30 Oct 2023 10:48:04 +0000 (+0100) Subject: ; * lisp/emacs-lisp/comp-cstr.el (comp-subtype-p): Hoist above use. X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0d452d61d0542cac710360f92fcb7c4fff92445b;p=emacs.git ; * lisp/emacs-lisp/comp-cstr.el (comp-subtype-p): Hoist above use. --- diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el index ee0ae10539d..82d48e59a23 100644 --- a/lisp/emacs-lisp/comp-cstr.el +++ b/lisp/emacs-lisp/comp-cstr.el @@ -293,6 +293,14 @@ Return them as multiple value." (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." + (let ((types (cons type1 type2))) + (or (gethash types (comp-cstr-ctxt-subtype-p-mem comp-ctxt)) + (puthash types + (memq type2 (comp-supertypes type1)) + (comp-cstr-ctxt-subtype-p-mem comp-ctxt))))) + (defun comp--normalize-typeset0 (typeset) ;; For every type search its supertypes. If all the subtypes of a ;; supertype are presents remove all of them, add the identified @@ -373,14 +381,6 @@ Return them as multiple value." (if above (comp--intersection x above) x))))) finally return above)) -(defsubst comp-subtype-p (type1 type2) - "Return t if TYPE1 is a subtype of TYPE2 or nil otherwise." - (let ((types (cons type1 type2))) - (or (gethash types (comp-cstr-ctxt-subtype-p-mem comp-ctxt)) - (puthash types - (memq type2 (comp-supertypes type1)) - (comp-cstr-ctxt-subtype-p-mem comp-ctxt))))) - (defun comp-union-typesets (&rest typesets) "Union types present into TYPESETS." (or (gethash typesets (comp-cstr-ctxt-union-typesets-mem comp-ctxt))