Lua Tricks
Lua Tricks
A few simple tricks you may or may not know: http://www.computercraft.info/forums2/i ... ave-known/
Re: Lua Tricks
All valid stuff. I'll add that using mytable[#mytable+1] = value is quicker than using table.insert(mytable, value) on there as the first thing.
Re: Lua Tricks
Interesting observation. Do you know if that becomes more or less the case as the table becomes REALLY big?
Re: Lua Tricks
I believe it still would be, yes. See http://www.lua.org/gems/sample.pdf (I recommend the entire Lua Gems book; I've got a print edition of it).
Additionally, see http://lua-users.org/wiki/OptimisationTips, http://lua-users.org/wiki/OptimisationCodingTips.
Additionally, see http://lua-users.org/wiki/OptimisationTips, http://lua-users.org/wiki/OptimisationCodingTips.