Optimise apply
with cons
in tail argument
* lisp/emacs-lisp/byte-opt.el (byte-optimize-apply): Transform (apply F ... (cons X Y)) -> (apply F ... X Y) This pattern is seen both in hand-written code and in backquote expansions.
This commit is contained in:
parent
77659bd463
commit
2a85d7a07c
1 changed files with 3 additions and 0 deletions
|
@ -1380,6 +1380,9 @@ See Info node `(elisp) Integer Basics'."
|
|||
;; (apply F ... (list X Y ...)) -> (funcall F ... X Y ...)
|
||||
((eq (car-safe last) 'list)
|
||||
`(funcall ,fn ,@(butlast (cddr form)) ,@(cdr last)))
|
||||
;; (apply F ... (cons X Y)) -> (apply F ... X Y)
|
||||
((eq (car-safe last) 'cons)
|
||||
(append (butlast form) (cdr last)))
|
||||
(t form)))
|
||||
form)))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue