[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Documenting Lua gotchas for newbies.
- From: steve donovan <steve.j.donovan@...>
- Date: Fri, 3 Dec 2010 15:24:09 +0200
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.