summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2019-12-03 11:36:04 -0500
committerNat Goodspeed <nat@lindenlab.com>2020-03-25 15:28:17 -0400
commit0c42f50d6ba2d9cb5ee164e186572ffc7a8dbedf (patch)
tree1dd2319b405fe3f73de21b3fa685138e8e9b2331
parent7a09a5391ac5172470eb6597f08b24cd5965e9ac (diff)
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.
-rw-r--r--indra/llcommon/lleventtimer.cpp13
1 files changed, 1 insertions, 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<LLEventTimer*> 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<LLEventTimer*>::iterator completed_iter = completed_timers.begin();
- completed_iter != completed_timers.end();
- completed_iter++ )
- {
- delete *completed_iter;
- }
- }
}