My guess on what the OP is asking is this: (Again, just a guess, as the OP wasn't very clear.)
Lua Code:
function DoStuff()
if myTable.var == "something" then
OtherFunction(myTable.var)
elseif myTable.var == "somethingelse" then
NextFunction(myTable.var)
else
LastFunction(myTable.var)
end
end
In the above pseudo-code, you are looking up the value of myTable.var 5 times. In this case, it would be more efficient to assign the value to a local variable and do this instead:
Lua Code:
function DoStuff()
local var = myTable.var
if var == "something" then
OtherFunction(var)
elseif var == "somethingelse" then
NextFunction(var)
else
LastFunction(var)
end
end
Granted, the gain is minimal unless this code is being executed at a high rate, such as for every OnUpdate or for an event that fires often.