View Single Post
07-24-16, 02:48 PM   #5
MuffinManKen
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 106
Originally Posted by semlar View Post
If the person who wrote it thought it was worth the extra effort to implement, it probably wouldn't be a good idea to take it out just to simplify the code, at least not unless you're quite certain it's redundant.
I have spent many years working on legacy code and I have seen no shortage of cases which convince me of the opposite of your argument.

I'm pretty sure that regardless of whether this would be a good place to do it, this implementation simply doesn't work. Here is the "Recycle" function:

Code:
function Recycle.prototype:Recycle()
	table.insert(self.recycleList, trash)
end
That is the only mention of the "trash" variable in the entire code base. So I guess most of the time it's just pushing nil into the table, which I *think* basically does nothing other than waste time. Of course since it isn't scoped, if another addon happened to assign something to the global "trash" then all sorts of fun would happen!
  Reply With Quote