mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-10 00:00:39 -08:00
Transform (list) -> nil in source optimiser
This optimisation is already done in the code generator but performing it at this earlier stage is a useful normalising step that uncovers more opportunities. * lisp/emacs-lisp/byte-opt.el (byte-optimize-list): New.
This commit is contained in:
parent
69223ee975
commit
eb0e93478e
1 changed files with 5 additions and 0 deletions
|
|
@ -1287,6 +1287,11 @@ See Info node `(elisp) Integer Basics'."
|
|||
`(list ,(nth 1 form))
|
||||
form))
|
||||
|
||||
(put 'list 'byte-optimizer #'byte-optimize-list)
|
||||
(defun byte-optimize-list (form)
|
||||
;; (list) -> nil
|
||||
(and (cdr form) form))
|
||||
|
||||
;; Fixme: delete-char -> delete-region (byte-coded)
|
||||
|
||||
(put 'set 'byte-optimizer #'byte-optimize-set)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue