Skip to content
Snippets Groups Projects
Commit 0c42f50d authored by Nat Goodspeed's avatar Nat Goodspeed
Browse files

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.
parent 7a09a539
No related branches found
No related tags found
No related merge requests found
...@@ -57,7 +57,6 @@ LLEventTimer::~LLEventTimer() ...@@ -57,7 +57,6 @@ LLEventTimer::~LLEventTimer()
//static //static
void LLEventTimer::updateClass() void LLEventTimer::updateClass()
{ {
std::list<LLEventTimer*> completed_timers;
for (auto& timer : instance_snapshot()) for (auto& timer : instance_snapshot())
{ {
F32 et = timer.mEventTimer.getElapsedTimeF32(); F32 et = timer.mEventTimer.getElapsedTimeF32();
...@@ -65,20 +64,10 @@ void LLEventTimer::updateClass() ...@@ -65,20 +64,10 @@ void LLEventTimer::updateClass()
timer.mEventTimer.reset(); timer.mEventTimer.reset();
if ( timer.tick() ) if ( timer.tick() )
{ {
completed_timers.push_back( &timer ); delete &timer;
} }
} }
} }
if ( completed_timers.size() > 0 )
{
for (std::list<LLEventTimer*>::iterator completed_iter = completed_timers.begin();
completed_iter != completed_timers.end();
completed_iter++ )
{
delete *completed_iter;
}
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment