A function f()
returns multiple values, which are to be fed into a second function g()
. I cannot change f()
, but I can change g()
and all calls to it. I’m wondering if it’s possible to say which variant performs best?
-
Function header with one table argument
function g(arg) --code end
and function call with table constructor
g({f()})
-
Function header with variable number of arguments
function g(...) --code end
and regular function call
g(f())
-
Function header with multiple variables
function g(x, y, z) --code end
and function call with
unpack
g(unpack(f()))
-
A completely different variant?