From 0f2257136d71389c274f0ab6dd68db3239da1d71 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 5 Nov 2021 04:24:14 +0000 Subject: Remove unused time_t field from the timer system. This is equivalent to calling InspIRCd::Now() and is only actually used in one place in modules. --- src/timer.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/timer.cpp') diff --git a/src/timer.cpp b/src/timer.cpp index c43e4ab0e..3a605f0e4 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -46,22 +46,23 @@ Timer::~Timer() ServerInstance->Timers.DelTimer(this); } -void TimerManager::TickTimers(time_t TIME) +void TimerManager::TickTimers() { + const time_t now = ServerInstance->Time(); for (TimerMap::iterator i = Timers.begin(); i != Timers.end(); ) { Timer* t = i->second; - if (t->GetTrigger() > TIME) + if (t->GetTrigger() > now) break; Timers.erase(i++); - if (!t->Tick(TIME)) + if (!t->Tick()) continue; if (t->GetRepeat()) { - t->SetTrigger(TIME + t->GetInterval()); + t->SetTrigger(now + t->GetInterval()); AddTimer(t); } } -- cgit v1.3.1-10-gc9f91