Issue found with PVS-Studio:

Many places utilize post-incrementation with iterators, but it's better performance to use pre-incrementation.

Resolved by changing the iter++ instances to ++iter;
This commit is contained in:
Areloch 2015-07-13 23:08:17 -05:00
parent ec63398042
commit 5c688260d5
8 changed files with 22 additions and 22 deletions

View file

@ -65,7 +65,7 @@ ForestWindMgr::ForestWindMgr()
ForestWindMgr::~ForestWindMgr()
{
IdToWindMap::Iterator sourceIter = mSources->begin();
for( ; sourceIter != mSources->end(); sourceIter++ )
for (; sourceIter != mSources->end(); ++sourceIter)
delete (*sourceIter).value;
delete mSources;
@ -185,7 +185,7 @@ void ForestWindMgr::processTick()
PROFILE_SCOPE( ForestWindMgr_AdvanceTime_Cleanup );
IdToWindMap::Iterator sourceIter = mPrevSources->begin();
for( ; sourceIter != mPrevSources->end(); sourceIter++ )
for (; sourceIter != mPrevSources->end(); ++sourceIter)
{
ForestWindAccumulator *accum = (*sourceIter).value;