]> git.eshelyaron.com Git - emacs.git/commitdiff
Remove unnecessary cons in function-type property
authorAndrea Corallo <acorallo@gnu.org>
Sun, 5 May 2024 21:39:01 +0000 (23:39 +0200)
committerEshel Yaron <me@eshelyaron.com>
Mon, 6 May 2024 16:56:34 +0000 (18:56 +0200)
* lisp/emacs-lisp/comp-common.el (comp-function-type-spec): Remove
unnecessary car.
* lisp/emacs-lisp/comp.el (comp--intern-func-in-ctxt): Likewise.
* lisp/emacs-lisp/byte-run.el (byte-run--set-function-type): Update
lambda list.

(cherry picked from commit f920959ac98afa8f8eb142abe94bec276fa7a2b7)

lisp/emacs-lisp/byte-run.el
lisp/emacs-lisp/comp-common.el
lisp/emacs-lisp/comp.el

index ae8fa2564672c3bee51476bcb7af5349706e7cec..201ed116b98f114bffe68e6d4c5c8c960ae7fc5f 100644 (file)
@@ -218,7 +218,7 @@ So far, FUNCTION can only be a symbol, not a lambda expression."
               val)))))
 
 (defalias 'byte-run--set-function-type
-  #'(lambda (f _args &rest val)
+  #'(lambda (f _args val)
       (list 'function-put (list 'quote f)
             ''function-type (list 'quote val))))
 
index ef40882a98a4e3a30c9e7e0deac56b10b0b14a01..355988838c713216ca4a4450b9bdcea7aaf7c25a 100644 (file)
@@ -517,7 +517,7 @@ itself."
       (when (and f (null type-spec))
         (if-let ((delc-type (function-get function 'function-type)))
             ;; Declared Lisp function
-            (setf type-spec (car delc-type))
+            (setf type-spec delc-type)
           (when (subr-native-elisp-p f)
             ;; Native compiled inferred
             (setf kind 'inferred
index b1e4b77ae4022f85192dfebfc45376e3eec3ec5b..e69de84362e6d96bd32ac1a6192540d6603fc77a 100644 (file)
@@ -825,7 +825,7 @@ clashes."
             (comp-func-lap func) lap
             (comp-func-frame-size func) (comp--byte-frame-size byte-func)
             (comp-func-speed func) (comp--spill-speed name)
-            (comp-func-declared-type func) (car (comp--spill-decl-spec name 'function-type))
+            (comp-func-declared-type func) (comp--spill-decl-spec name 'function-type)
             (comp-func-pure func) (comp--spill-decl-spec name 'pure))
 
       ;; Store the c-name to have it retrievable from