luau
luau copied to clipboard
[COMPILER OPTIMIZATION] Simplify Conditional Logic Expressions
Compiler should optimize
do
return value == "" and value
end
into
do
return value == "" and ""
end
With local
s the difference gap gets smaller for each optimize level until it's barely noticeable.
With globals (GETGLOBAL|GETIMPORT)
the difference stays noticeable on all optimize levels.
Likewise for the if-then-else
expressions and any other conditional logic expressions
There's also a chance that similar logic can be applied to other places in code.