From 0c42f50d6ba2d9cb5ee164e186572ffc7a8dbedf Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 3 Dec 2019 11:36:04 -0500 Subject: DRTVWR-494: Streamline LLEventTimer::updateClass(). No need to capture a separate list of completed LLEventTimer instances to delete after the primary loop, since at this point we're looping over a snapshot and can directly delete each completed timer. --- indra/llcommon/lleventtimer.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/indra/llcommon/lleventtimer.cpp b/indra/llcommon/lleventtimer.cpp index 3986dee3ac..f575a7b6bf 100644 --- a/indra/llcommon/lleventtimer.cpp +++ b/indra/llcommon/lleventtimer.cpp @@ -57,7 +57,6 @@ LLEventTimer::~LLEventTimer() //static void LLEventTimer::updateClass() { - std::list completed_timers; for (auto& timer : instance_snapshot()) { F32 et = timer.mEventTimer.getElapsedTimeF32(); @@ -65,20 +64,10 @@ void LLEventTimer::updateClass() timer.mEventTimer.reset(); if ( timer.tick() ) { - completed_timers.push_back( &timer ); + delete &timer; } } } - - if ( completed_timers.size() > 0 ) - { - for (std::list::iterator completed_iter = completed_timers.begin(); - completed_iter != completed_timers.end(); - completed_iter++ ) - { - delete *completed_iter; - } - } } -- cgit v1.2.3