Prefer erase over repeated pop_front calls

This commit is contained in:
Anthony J. Thibault 2015-12-16 19:08:31 -08:00
parent 1b08563079
commit 2eecb61da5

View file

@ -608,10 +608,7 @@ void ParticleEffectEntityItem::stepSimulation(float deltaTime) {
integrateParticle(particle, deltaTime);
}
}
for (int i = 0; i < popCount; i++) {
_particles.pop_front();
}
_particles.erase(_particles.begin(), _particles.begin() + popCount);
// emit new particles, but only if we are emmitting
if (getIsEmitting() && _emitRate > 0.0f && _lifespan > 0.0f && _polarStart <= _polarFinish) {