Advise against careless use of throw-away tables and link HOWTO discussing minimizing their impact.
(demoted headings) |
(Advise against careless use of throw-away tables and link HOWTO discussing minimizing their impact.) |
||
| Line 82: | Line 82: | ||
DoStuff() | DoStuff() | ||
end | end | ||
=== Minimize use of throw-away tables === | |||
Tables in Lua, being powerful instrument, can cause your addon to pollute memory with unnecessary garbage if you're not careful, as tables are one of value types that are not reused automatically. It is better not to use repeatedly generated throw-away tables unless they provide far easier to read solution, faster code or if your task is impossible to handle without them at all. In some cases you can minimize garbage generation when using those as explained in [[HOWTO: Use Tables Without Generating Extra Garbage]]. | |||
== API & XML == | == API & XML == | ||