Hi been wondering this for a while, as some of you should already know it best for performance to localise math functions/methods. Like so: local rand = math.random
My question is it best for performance to localise within every function that it uses or just once for all functions?
Within every function
local function randomObject()
local rand = math.random
local randomObject = objects[rand(#objects)]
return randomObject
end
Or Outside of function
local rand = math.random
local function randomObject()
local randomObject = objects[rand(#objects)]
return randomObject
end
Any insight is appreciated. [import]uid: 118379 topic_id: 26253 reply_id: 326253[/import]