]> git.eshelyaron.com Git - emacs.git/commit
Optimise away functions in for-effect context
authorMattias Engdegård <mattiase@acm.org>
Sun, 26 Jun 2022 16:46:13 +0000 (18:46 +0200)
committerMattias Engdegård <mattiase@acm.org>
Sun, 26 Jun 2022 18:43:28 +0000 (20:43 +0200)
commitf2a5d48e89bc5611c9cc9aeb978faacee32de6c8
tree32d6d31fd8570bfaf2c491f0c47db88ae4f1077d
parentd3893d7e8e20b392e531f00981191138e26d8bff
Optimise away functions in for-effect context

* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Turn functions into nil when compiled for-effect since they have no
side-effects on their own.  This may enable further improvements such
as the elimination of variable bindings.
`unwind-protect` forms can be treated as plain function call at this
point.  In particular, their unwind function argument should be
not optimised for effect since it's a function.
lisp/emacs-lisp/byte-opt.el