darklua
darklua copied to clipboard
Unwrap small numeric for loops
When a numeric for statement is used with a constant start, end and/or step value, the loop can be unwrapped into the repeated statements of the block.
This rule should be parametrized with the maximum iteration count ((end - start) / step) and the number of statements in the block.
for i=1, 3 do
print(i)
end
Turns into:
print(1)
print(2)
print(3)