diff options
| author | Nat Goodspeed <nat@lindenlab.com> | 2019-12-03 11:36:04 -0500 | 
|---|---|---|
| committer | Nat Goodspeed <nat@lindenlab.com> | 2020-03-25 15:28:17 -0400 | 
| commit | 0c42f50d6ba2d9cb5ee164e186572ffc7a8dbedf (patch) | |
| tree | 1dd2319b405fe3f73de21b3fa685138e8e9b2331 /indra/llcommon | |
| parent | 7a09a5391ac5172470eb6597f08b24cd5965e9ac (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.
Diffstat (limited to 'indra/llcommon')
| -rw-r--r-- | indra/llcommon/lleventtimer.cpp | 13 | 
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; -		} -	}  } | 
