From 0f2a52b655ca06ae7f1baec24dd6392a3449f08b Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Sun, 5 May 2024 23:39:01 +0200 Subject: [PATCH] Remove unnecessary cons in function-type property * 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 | 2 +- lisp/emacs-lisp/comp-common.el | 2 +- lisp/emacs-lisp/comp.el | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index ae8fa256467..201ed116b98 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -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)))) diff --git a/lisp/emacs-lisp/comp-common.el b/lisp/emacs-lisp/comp-common.el index ef40882a98a..355988838c7 100644 --- a/lisp/emacs-lisp/comp-common.el +++ b/lisp/emacs-lisp/comp-common.el @@ -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 diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index b1e4b77ae40..e69de84362e 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -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 -- 2.39.5