lua-users home
lua-l archive

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


On Fri, Dec 3, 2010 at 2:16 PM, Hisham <hisham.hm@gmail.com> wrote:

>   table.insert(responses.handlers[selected].messages, msg)

Yes, and often we make a sensible local alias

local append = table.insert

and things read even better and it's faster.

And this is not _much_ slower than the unwieldy t[#t+1]; if you need
to fill a table fast, then
   t[n] = val
   n = n + 1
is still the speed king.

steve d.