diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2021-11-02 14:48:55 +0100 |
---|---|---|
committer | Mattias EngdegÄrd <mattiase@acm.org> | 2021-11-02 22:46:20 +0100 |
commit | 493fde95bed6c65e049b8e664837397546847b37 (patch) | |
tree | 1ec80cf28953b9ff84116f2e55c78b55add185e2 /lisp/emacs-lisp | |
parent | 11702a6dd7cb8286f28b7cb986057d2d2c66a914 (diff) | |
download | emacs-493fde95bed6c65e049b8e664837397546847b37.tar.gz emacs-493fde95bed6c65e049b8e664837397546847b37.tar.bz2 emacs-493fde95bed6c65e049b8e664837397546847b37.zip |
Optimise (cond) => nil at source level
* lisp/emacs-lisp/byte-opt.el (byte-optimize-cond):
Optimise clause-free `cond`, which can arise from earlier
transformations. This enables further optimisations.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add test cases.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/byte-opt.el | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 9b3b2e5ce14..9c64083b64b 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -1327,7 +1327,7 @@ See Info node `(elisp) Integer Basics'." (list 'or (car (car clauses)) (byte-optimize-cond (cons (car form) (cdr (cdr form))))) - form)) + (and clauses form))) form)) (defun byte-optimize-if (form) |