Heya!
I’ve been wondering if running a for loop only ONCE is worse performance wise than just running a single line of code.
This might sound like a useless question but I have a use case lol (more at the end of the post).
What I mean with running a for loop once:
for i = 1, 1, do
-- Code stuff
end
What I mean with running a line of code:
-- Code stuff (no loop which runs this)
My use case would be this:
I want my code in the loop to run the value of x. But x is not always given and it depends on the situation. With the below I wanted to prevent to repeat my code twice.
for i = 1, x or 1 do
-- code stuff
end
Hopefully someone can tell me.
Thanks.