Originally Posted by DashingSplash
I got a bit intrigued by the table wipe discussion since I used it for my first AddOn that I made (or rather an early version of my first AddOn). Since I had trouble with the tables keeping their old values when the UPDATE_BINDINGS event was triggered I had to wipe the tables as shown below.
Lua Code:
local table_1 = {t = {}, st = {}, ct = {}, at = {}} --Filled after dashingUpdate has executed local table_2 = {t2 = {}, st2 = {}, ct2 = {}, at2 = {}} --Filled after dashingUpdate has executed local function dashingUpdate(self, event, ...) for _, tableWipe in pairs(table_1) do wipe(tableWipe) end for _, tableWipe in pairs(table_2) do wipe(tableWipe) end end
Would this actually be an OK way to do it, or would I get problems if the addon had been updating a lot more?
|
Depends on what the rest of your code looks like. If you're already running the same loops later in the code when you write to the tables, do it there.