diff options
| author | Eli Zaretskii | 2022-12-16 19:27:33 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2022-12-16 19:27:33 +0200 |
| commit | 856d889f3a87cd6a45c52db2adc6b1a4fdc9295a (patch) | |
| tree | 21bce18eca8f858d3163cc9bcc677543903669a5 | |
| parent | 8e42e20ed7f3c243542acf3ea1cd34e38e36aace (diff) | |
| download | emacs-856d889f3a87cd6a45c52db2adc6b1a4fdc9295a.tar.gz emacs-856d889f3a87cd6a45c52db2adc6b1a4fdc9295a.zip | |
Revert "Elide broken but unnecessary `if` optimisations"
This reverts commit 13aa376e93564a8cf2ddbbcf0968c6666620db89.
Please don't install anything on the release branch that is
not a clear bugfix for a known bug.
| -rw-r--r-- | lisp/emacs-lisp/byte-opt.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 0da2a9b882d..a7e1df3622d 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el | |||
| @@ -1297,8 +1297,11 @@ See Info node `(elisp) Integer Basics'." | |||
| 1297 | (if else | 1297 | (if else |
| 1298 | `(progn ,condition ,@else) | 1298 | `(progn ,condition ,@else) |
| 1299 | condition)) | 1299 | condition)) |
| 1300 | ;; (if X t) -> (not (not X)) | 1300 | ;; (if X nil t) -> (not X) |
| 1301 | ((and (eq then t) (null else)) | 1301 | ((and (eq then nil) (eq else '(t))) |
| 1302 | `(not ,condition)) | ||
| 1303 | ;; (if X t [nil]) -> (not (not X)) | ||
| 1304 | ((and (eq then t) (or (null else) (eq else '(nil)))) | ||
| 1302 | `(not ,(byte-opt--negate condition))) | 1305 | `(not ,(byte-opt--negate condition))) |
| 1303 | ;; (if VAR VAR X...) -> (or VAR (progn X...)) | 1306 | ;; (if VAR VAR X...) -> (or VAR (progn X...)) |
| 1304 | ((and (symbolp condition) (eq condition then)) | 1307 | ((and (symbolp condition) (eq condition then)) |