mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
Better 'prog1' optimisation
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Always evaporate 'prog1' when the tail is effect-free, even when the value expression isn't.
This commit is contained in:
parent
2e7a066d56
commit
badef58d0a
1 changed files with 3 additions and 3 deletions
|
|
@ -345,9 +345,9 @@ There can be multiple entries for the same NAME if it has several aliases.")
|
|||
(let ((exp-opt (byte-optimize-form exp for-effect)))
|
||||
(if exps
|
||||
(let ((exps-opt (byte-optimize-body exps t)))
|
||||
(if (macroexp-const-p exp-opt)
|
||||
`(progn ,@exps-opt ,exp-opt)
|
||||
`(,fn ,exp-opt ,@exps-opt)))
|
||||
(cond ((null exps-opt) exp-opt)
|
||||
((macroexp-const-p exp-opt) `(progn ,@exps-opt ,exp-opt))
|
||||
(t `(,fn ,exp-opt ,@exps-opt))))
|
||||
exp-opt)))
|
||||
|
||||
(`(,(or `save-excursion `save-restriction `save-current-buffer) . ,exps)
|
||||
|
|
|
|||
Loading…
Reference in a new issue