-local type, unpack, next, error, pairs, tostring, select = type, unpack, next, error, pairs, tostring, select
-
--- Upvalue our private data
-local inactiveTimers = AceTimer.inactiveTimers
-local activeTimers = AceTimer.activeTimers
-
-local function OnFinished(self)
- local id = self.id
- if type(self.func) == "string" then
- -- We manually set the unpack count to prevent issues with an arg set that contains nil and ends with nil
- -- e.g. local t = {1, 2, nil, 3, nil} print(#t) will result in 2, instead of 5. This fixes said issue.
- self.object[self.func](self.object, unpack(self.args, 1, self.argsCount))
- else
- self.func(unpack(self.args, 1, self.argsCount))
- end
-
- -- If the id is different it means that the timer was already cancelled
- -- and has been used to create a new timer during the OnFinished callback.
- if not self.looping and id == self.id then
- activeTimers[self.id] = nil
- self.args = nil
- inactiveTimers[self] = true
- end
-end
+local type, unpack, next, error, select = type, unpack, next, error, select
+-- WoW APIs
+local GetTime, C_TimerAfter = GetTime, C_Timer.After