You're missing the point by a very large margin. The point is
not that calling Function A can get you info faster than calling Function B under Circumstance X. The point is that
calling a function at all is much slower than assigning an extra variable, and you should not call functions if you don't need to -- specifically, there is almost no reason to ever use
select.
Using your example, you should
not do this:
Code:
local textureIndex = select(3, GetMapLandmarkInfo(i))
if textureIndex == 128 then
-- do something
end
Instead, you
should do this:
Code:
local _, _, textureIndex = GetMapLandmarkInfo(i)
if textureIndex == 128 then
-- do something
end
You can get the
exact same information from the
exact same function, without the overhead of a second function call that's completely unnecessary and does not affect the information obtained or the source of the information.