lua-users home
lua-l archive

Re: What is the fastest way to concatenate here?

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Some small corrections:
 foo = function(funcs)
 local t = { }
- for _, fun in pairs(funcs) do
- table.insert(t, fun())
+ for i, fun in ipairs(funcs) do
+ t[i] = fun()
 end
 return table.concat(t)
 end
--
Wim

AltStyle によって変換されたページ (->オリジナル) /