lua-users home
lua-l archive

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


On Thu, Jan 19, 2012 at 06:58, Dirk Laurie <dirk.laurie@gmail.com> wrote:
>
> I'm breaking a New Year's resolution … oh well it lasted 19 days …
> "Don't pour cold water on cute suggestions to improve Lua" …
>
> append = table.insert  -- I do this anyway in just about every program I write
> ...
> append(my_long_descriptive_table_name,val)

t[#t+1] is more efficient. It directly translates into SETTABLE opcode
while append goes through a function call first.

--Leo--