diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-01-16 18:06:33 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-01-16 18:06:33 +0300 |
commit | 933cfb877f43b25045ae129adff3144fd79ee3a1 (patch) | |
tree | cc222de03145f9b6eda4eb7402034b069b1492c8 /src/actorspritemanager.cpp | |
parent | 70d4f24f38a4036f84c1f71803173199e95ad675 (diff) | |
download | manaplus-933cfb877f43b25045ae129adff3144fd79ee3a1.tar.gz manaplus-933cfb877f43b25045ae129adff3144fd79ee3a1.tar.bz2 manaplus-933cfb877f43b25045ae129adff3144fd79ee3a1.tar.xz manaplus-933cfb877f43b25045ae129adff3144fd79ee3a1.zip |
Add macro for for and iterators.
Diffstat (limited to 'src/actorspritemanager.cpp')
-rw-r--r-- | src/actorspritemanager.cpp | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/src/actorspritemanager.cpp b/src/actorspritemanager.cpp index 4ccb2e347..5287019ab 100644 --- a/src/actorspritemanager.cpp +++ b/src/actorspritemanager.cpp @@ -273,10 +273,7 @@ void ActorSpriteManager::undelete(const ActorSprite *const actor) if (!actor || actor == player_node) return; - ActorSpritesConstIterator it, it_end; - - for (it = mDeleteActors.begin(), it_end = mDeleteActors.end(); - it != it_end; ++it) + FOR_EACH (ActorSpritesConstIterator, it, mDeleteActors) { if (*it == actor) { @@ -760,9 +757,7 @@ void ActorSpriteManager::logic() } BLOCK_START("ActorSpriteManager::logic 1") - for (ActorSpritesConstIterator it = mDeleteActors.begin(), - it_end = mDeleteActors.end(); - it != it_end; ++it) + FOR_EACH (ActorSpritesConstIterator, it, mDeleteActors) { if (!*it) continue; @@ -785,9 +780,7 @@ void ActorSpriteManager::logic() viewport->clearHover(*it); } - for (ActorSpritesConstIterator it = mDeleteActors.begin(), - it_end = mDeleteActors.end(); - it != it_end; ++it) + FOR_EACH (ActorSpritesConstIterator, it, mDeleteActors) { mActors.erase(*it); delete *it; @@ -906,9 +899,7 @@ Being *ActorSpriteManager::findNearestLivingBeing(const Being *const { std::vector<Being*> sortedBeings; - for (ActorSprites::const_iterator i = mActors.begin(), - i_end = mActors.end(); - i != i_end; ++i) + FOR_EACH (ActorSprites::const_iterator, i, mActors) { if (!*i) continue; @@ -1003,9 +994,7 @@ Being *ActorSpriteManager::findNearestLivingBeing(const Being *const int index = defaultPriorityIndex; Being *closestBeing = nullptr; - for (ActorSprites::const_iterator i = mActors.begin(), - i_end = mActors.end(); - i != i_end; ++i) + FOR_EACH (ActorSprites::const_iterator, i, mActors) { if (!*i) continue; @@ -1294,9 +1283,7 @@ void ActorSpriteManager::printBeingsToChat(ActorSprites beings, debugChatTab->chatLog("---------------------------------------"); debugChatTab->chatLog(header); - std::set<ActorSprite*>::const_iterator it; - const std::set<ActorSprite*>::const_iterator it_end = beings.end(); - for (it = beings.begin(); it != it_end; ++it) + FOR_EACH (std::set<ActorSprite*>::const_iterator, it, beings) { if (!*it) continue; @@ -1323,9 +1310,7 @@ void ActorSpriteManager::printBeingsToChat(std::vector<Being*> beings, debugChatTab->chatLog("---------------------------------------"); debugChatTab->chatLog(header); - std::vector<Being*>::const_iterator i; - const std::vector<Being*>::const_iterator i_end = beings.end(); - for (i = beings.begin(); i != i_end; ++i) + FOR_EACH (std::vector<Being*>::const_iterator, i, beings) { if (!*i) continue; |