Originally Posted by AnrDaemon
I've also dropped a check for "func = handler[func]" as redundant and not really adding to the performance.
|
I assume you mean this part:
Code:
if handler then
func = handler[func]
end
This is there so you can register events AceEvent-style:
Code:
addon:RegisterEvent("PLAYER_LOGIN", "InitializeAllTheThings", addon)
But yes, you would need to remove it (or change it to a type check) if you wanted to use this syntax instead:
Code:
addon:RegisterEvent("PLAYER_LOGIN", addon.InitializeAllTheThings, addon)
However, there's no possibly imaginable performance concern to a single "if value then" check in a function that's only called when you're unregistering an event, so if that's really your motivation for removing it -- don't.