diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-04-25 02:26:34 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-04-25 02:26:34 +0300 |
commit | c9f43996f3147100627ee2c6f9da993ceb160113 (patch) | |
tree | 7577f02f4658b19e05d586f66b67a9a4f5fedb7e /src/actorspritemanager.cpp | |
parent | 8e19f9b9d792cf4d3d3b022fd26a258c3d3d97bf (diff) | |
download | mv-c9f43996f3147100627ee2c6f9da993ceb160113.tar.gz mv-c9f43996f3147100627ee2c6f9da993ceb160113.tar.bz2 mv-c9f43996f3147100627ee2c6f9da993ceb160113.tar.xz mv-c9f43996f3147100627ee2c6f9da993ceb160113.zip |
Improve iterators part 2.
Diffstat (limited to 'src/actorspritemanager.cpp')
-rw-r--r-- | src/actorspritemanager.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/actorspritemanager.cpp b/src/actorspritemanager.cpp index bcb807131..327d45a89 100644 --- a/src/actorspritemanager.cpp +++ b/src/actorspritemanager.cpp @@ -1133,7 +1133,8 @@ void ActorSpriteManager::addBlock(Uint32 id) void ActorSpriteManager::deleteBlock(Uint32 id) { std::vector<Uint32>::iterator iter = blockedBeings.begin(); - while (iter != blockedBeings.end()) + std::vector<Uint32>::iterator iter_end = blockedBeings.end(); + while (iter != iter_end) { if (*iter == id) { @@ -1171,7 +1172,8 @@ void ActorSpriteManager::printBeingsToChat(ActorSprites beings, debugChatTab->chatLog("---------------------------------------"); debugChatTab->chatLog(header); std::set<ActorSprite*>::const_iterator it; - for (it = beings.begin(); it != beings.end(); ++it) + std::set<ActorSprite*>::const_iterator it_end = beings.end(); + for (it = beings.begin(); it != it_end; ++it) { if (!*it) continue; @@ -1199,7 +1201,8 @@ void ActorSpriteManager::printBeingsToChat(std::vector<Being*> beings, debugChatTab->chatLog(header); std::vector<Being*>::const_iterator i; - for (i = beings.begin(); i != beings.end(); ++i) + std::vector<Being*>::const_iterator i_end = beings.end(); + for (i = beings.begin(); i != i_end; ++i) { if (!*i) continue; @@ -1484,7 +1487,8 @@ void ActorSpriteManager::loadAttackList() std::list<std::string> list = unpackList( serverConfig.getValue("attackPriorityMobs", "")); std::list<std::string>::const_iterator i = list.begin(); - while (i != list.end()) + std::list<std::string>::const_iterator i_end = list.end(); + while (i != i_end) { if (*i == "") empty = true; @@ -1495,7 +1499,8 @@ void ActorSpriteManager::loadAttackList() list = unpackList(serverConfig.getValue("attackMobs", "")); i = list.begin(); - while (i != list.end()) + i_end = list.end(); + while (i != i_end) { if (*i == "") empty = true; @@ -1506,7 +1511,8 @@ void ActorSpriteManager::loadAttackList() list = unpackList(serverConfig.getValue("ignoreAttackMobs", "")); i = list.begin(); - while (i != list.end()) + i_end = list.end(); + while (i != i_end) { if (*i == "") empty = true; |