Originally Posted by Mikord
The simplest answer is that ipairs ... is an ... function.
|
Fixed. Calling functions is basically the slowest thing you can do in Lua, so you should do it as little as possible. In the same vein, if you ever find yourself writing something like this:
Code:
local function DoAnotherThing()
-- do another thing here
end
local function DoAThing()
-- do a thing here
if something then
DoAnotherThing()
end
end
DoAThing()
... ask yourself if the code inside the DoAnotherThing() function will ever actually be called from anywhere else. If the answer is "no", then you should just move that code into the DoAThing() function.