mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 09:14:18 +00:00
; Simplify 'prog1' optimiser
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Drop unnecessary condition. Noticed by Pip Cet.
This commit is contained in:
parent
b12a068352
commit
beb9c26d4c
1 changed files with 6 additions and 7 deletions
|
|
@ -341,14 +341,13 @@ There can be multiple entries for the same NAME if it has several aliases.")
|
|||
(if (cdr exps)
|
||||
(macroexp-progn (byte-optimize-body exps for-effect))
|
||||
(byte-optimize-form (car exps) for-effect)))
|
||||
|
||||
(`(prog1 ,exp . ,exps)
|
||||
(let ((exp-opt (byte-optimize-form exp for-effect)))
|
||||
(if exps
|
||||
(let ((exps-opt (byte-optimize-body exps t)))
|
||||
(cond ((null exps-opt) exp-opt)
|
||||
((macroexp-const-p exp-opt) `(progn ,@exps-opt ,exp-opt))
|
||||
(t `(,fn ,exp-opt ,@exps-opt))))
|
||||
exp-opt)))
|
||||
(let ((exp-opt (byte-optimize-form exp for-effect))
|
||||
(exps-opt (byte-optimize-body exps t)))
|
||||
(cond ((null exps-opt) exp-opt)
|
||||
((macroexp-const-p exp-opt) `(progn ,@exps-opt ,exp-opt))
|
||||
(t `(,fn ,exp-opt ,@exps-opt)))))
|
||||
|
||||
(`(,(or `save-excursion `save-restriction `save-current-buffer) . ,exps)
|
||||
;; Those subrs which have an implicit progn; it's not quite good
|
||||
|
|
|
|||
Loading…
Reference in a new issue