From http://www.lua.org/pil/6.3.html: In Lua, only a call in the format return g(...) is a tail call.
.
So in this case you are missing the tail call optimization yes.
문제
Whenever I have a function to call at the end of another, I always call it on the same line as the return, like so, return foo(x)
.
Would assigning the result to a variable botch any possibility of tail optimization? Like this,
function(...)
...
tmp = foo(x)
return tmp
end
해결책
From http://www.lua.org/pil/6.3.html: In Lua, only a call in the format return g(...) is a tail call.
.
So in this case you are missing the tail call optimization yes.