diff options
| author | Adam Goertz <adambgoertz@gmail.com> | 2023-11-04 23:00:28 +0000 |
|---|---|---|
| committer | Adam Goertz <adambgoertz@gmail.com> | 2023-11-06 04:31:55 +0000 |
| commit | 91570cc42d4fe973d15ac05cdecff42051f154ad (patch) | |
| tree | 933200ee149c2557d3739ed7332e59b4e7ca341e /src/Compilation.zig | |
| parent | 1b0b46a8a9f5ed3ebaf35e3018fd5402957552ae (diff) | |
| download | zig-91570cc42d4fe973d15ac05cdecff42051f154ad.tar.gz zig-91570cc42d4fe973d15ac05cdecff42051f154ad.zip | |
zig-reduce: Reduce `if` expressions
Perform these transformations in this priority order:
1. If the `else` expression is missing or an empty block, replace the condition with `if (true)` if it is not already.
2. If the `then` block is empty, replace the condition with `if (false)` if it is not already.
3. If the condition is `if (true)`, replace the `if` expression with the contents of the `then` expression.
4. If the condition is `if (false)`, replace the `if` expression with the contents of the `else` expression.
Diffstat (limited to 'src/Compilation.zig')
0 files changed, 0 insertions, 0 deletions
