diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index c5458c1ba69..1aecae5ac7d 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -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)