mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-02 16:18:19 +00:00
Add IfElseSwap option
This enables an option that was being done unconditionally: to swap the `if` and `else` branches if the condition is shorter when negated. Enabled by default.
This commit is contained in:
parent
e62b5ffcb6
commit
08c429f22b
8 changed files with 44 additions and 17 deletions
15
unit_tests/regression.suite/if-else-noswap.out
Normal file
15
unit_tests/regression.suite/if-else-noswap.out
Normal file
|
@ -0,0 +1,15 @@
|
|||
default
|
||||
{
|
||||
timer()
|
||||
{
|
||||
integer a = llGetLinkNumber();
|
||||
if (a == 3)
|
||||
llOwnerSay("1");
|
||||
else
|
||||
llOwnerSay("2");
|
||||
if (!a)
|
||||
llOwnerSay("3");
|
||||
else
|
||||
llOwnerSay("4");
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue