Commit 1ba5b64d authored by Mattias Engdegård's avatar Mattias Engdegård

Optimise 'while' bodies for effect

* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Treat all expressions in the body of 'while' as for-effect,
since their values are discarded.  This also finds some errors.
parent af085ef4
Pipeline #4407 failed with stage
in 79 minutes and 58 seconds
......@@ -480,6 +480,13 @@
backwards)))))
(cons fn (mapcar 'byte-optimize-form (cdr form)))))
((eq fn 'while)
(unless (consp (cdr form))
(byte-compile-warn "too few arguments for `while'"))
(cons fn
(cons (byte-optimize-form (cadr form) nil)
(byte-optimize-body (cddr form) t))))
((eq fn 'interactive)
(byte-compile-warn "misplaced interactive spec: `%s'"
(prin1-to-string form))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment