Originally Posted by myrroddin
You should also define the table t outside the function. Right now you are (re)creating the table every time the function runs, which is terribad.
|
For a testing/debugging function, there's nothing wrong with recreating the table every time the function runs.
For production functions, it depends on the purpose of the table, and the frequency with which the function will be run. If it's an OnUpdate script, or running in response to UNIT_AURA events, yes, creating a new table on each run is a big no-no. If it's running in response to a user entering a slash command, or an infrequent event like PLAYER_ENTERING_WORLD, it's not really a big deal, and you should do whatever makes more sense scope-wise for the content/purpose of the table.