projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8e42e20
)
Revert "Elide broken but unnecessary `if` optimisations"
author
Eli Zaretskii
<eliz@gnu.org>
Fri, 16 Dec 2022 17:27:33 +0000
(19:27 +0200)
committer
Eli Zaretskii
<eliz@gnu.org>
Fri, 16 Dec 2022 17:27:33 +0000
(19:27 +0200)
This reverts commit
13aa376e93564a8cf2ddbbcf0968c6666620db89
.
Please don't install anything on the release branch that is
not a clear bugfix for a known bug.
lisp/emacs-lisp/byte-opt.el
patch
|
blob
|
history
diff --git
a/lisp/emacs-lisp/byte-opt.el
b/lisp/emacs-lisp/byte-opt.el
index 0da2a9b882dade73dfe7ead1ecf696bc4e2de84e..a7e1df3622d0bf824d0c851f18f7b01dfea5407b 100644
(file)
--- a/
lisp/emacs-lisp/byte-opt.el
+++ b/
lisp/emacs-lisp/byte-opt.el
@@
-1297,8
+1297,11
@@
See Info node `(elisp) Integer Basics'."
(if else
`(progn ,condition ,@else)
condition))
- ;; (if X t) -> (not (not X))
- ((and (eq then t) (null else))
+ ;; (if X nil t) -> (not X)
+ ((and (eq then nil) (eq else '(t)))
+ `(not ,condition))
+ ;; (if X t [nil]) -> (not (not X))
+ ((and (eq then t) (or (null else) (eq else '(nil))))
`(not ,(byte-opt--negate condition)))
;; (if VAR VAR X...) -> (or VAR (progn X...))
((and (symbolp condition) (eq condition then))