mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 15:48:21 +00:00
When the tree has a unary minus node (NEG) whose child is a product node (*), and the left operand of the product node starts with a minus sign but is not a NEG node, this produced at least two minus signs in sequence without any spaces. Normally, OptSigns hides this problem, but when it is disabled, or when the left factor is a pre-decrement (--V) node, the problem is visible. Fix by creating a function that detects all kinds of leading minus signs, and use it in place of the comparison with NEG. Fixes #31. Reported by @KrsityKu, who also provided a repro.
14 lines
408 B
Text
14 lines
408 B
Text
default
|
|
{
|
|
timer()
|
|
{
|
|
integer ia = llGetUnixTime();
|
|
integer ib = llGetUnixTime();
|
|
integer ie = -(-5) * ia;
|
|
float fa = llGetTime();
|
|
float fb = llGetTime();
|
|
float fe = -(-5.5) * fa;
|
|
llOwnerSay((string)[-(--ia) * ib * ib, -++ia * ib * ib, (--ia) * ib, ie]);
|
|
llOwnerSay((string)[-(--fa) * fb * fb, -++fa * fb * fb, (--fa) * fb, fe]);
|
|
}
|
|
}
|