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.
scratch/comp-safety2
Andrea Corallo 2024-05-05 23:39:01 +02:00
parent 77f87d4b48
commit f920959ac9
3 changed files with 3 additions and 3 deletions

View 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))))

View 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

View 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