3 ms·
Lua is global by default. Declare all the variables as local and you'll see significant improvement. Also, there is a boolean type so you can use true and false
by whoopdedo 11y ago
Lua is global by default. Declare all the variables as local and you'll see significant improvement. Also, there is a boolean type so you can use true and false directly instead of comparing numbers.
- ryanmk 11y agoI tried using locals, and there was no change to the time. Using a boolean return value for isPrime shaved off two seconds.