summaryrefslogtreecommitdiff
path: root/src/particlecontainer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-04-25 02:26:34 +0300
committerAndrei Karas <akaras@inbox.ru>2012-04-25 02:26:34 +0300
commitc9f43996f3147100627ee2c6f9da993ceb160113 (patch)
tree7577f02f4658b19e05d586f66b67a9a4f5fedb7e /src/particlecontainer.cpp
parent8e19f9b9d792cf4d3d3b022fd26a258c3d3d97bf (diff)
downloadmanaverse-c9f43996f3147100627ee2c6f9da993ceb160113.tar.gz
manaverse-c9f43996f3147100627ee2c6f9da993ceb160113.tar.bz2
manaverse-c9f43996f3147100627ee2c6f9da993ceb160113.tar.xz
manaverse-c9f43996f3147100627ee2c6f9da993ceb160113.zip
Improve iterators part 2.
Diffstat (limited to 'src/particlecontainer.cpp')
-rw-r--r--src/particlecontainer.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/particlecontainer.cpp b/src/particlecontainer.cpp
index e39f4dd86..9421e6354 100644
--- a/src/particlecontainer.cpp
+++ b/src/particlecontainer.cpp
@@ -75,9 +75,8 @@ void ParticleList::addLocally(Particle *particle)
void ParticleList::removeLocally(Particle *particle)
{
- std::list<Particle *>::iterator it, it_end;
- for (it = mElements.begin(), it_end = mElements.end();
- it != it_end; )
+ for (std::list<Particle *>::iterator it = mElements.begin();
+ it != mElements.end(); )
{
if (*it == particle)
{
@@ -93,8 +92,8 @@ void ParticleList::removeLocally(Particle *particle)
void ParticleList::clearLocally()
{
- for (std::list<Particle *>::const_iterator it = mElements.begin();
- it != mElements.end(); ++it)
+ for (std::list<Particle *>::const_iterator it = mElements.begin(),
+ it_end = mElements.end(); it != it_end; ++ it)
{
(*it)->kill();
}