WoW:USERAPI EraseTable

Revision as of 01:18, 12 February 2007 by WoWWiki>Tekkub
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This page documents a <i>user-defined function</i> that you can copy and paste into your addon. Replace PREFIX with your addon or lib prefix to avoid conflicts between different versions of these functions.

User defined functions


Erases a table, often a good way to reduce garbage creation. Note that erasing a table is generally more expensive than letting the GC system reclaim it, so one might prefer simply reallocating a new empty table.

local function EraseTable(t)
	for i in pairs(t) do t[i] = nil end
end