summaryrefslogtreecommitdiff
path: root/src/commandhandler.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/commandhandler.cpp
parent8e19f9b9d792cf4d3d3b022fd26a258c3d3d97bf (diff)
downloadplus-c9f43996f3147100627ee2c6f9da993ceb160113.tar.gz
plus-c9f43996f3147100627ee2c6f9da993ceb160113.tar.bz2
plus-c9f43996f3147100627ee2c6f9da993ceb160113.tar.xz
plus-c9f43996f3147100627ee2c6f9da993ceb160113.zip
Improve iterators part 2.
Diffstat (limited to 'src/commandhandler.cpp')
-rw-r--r--src/commandhandler.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp
index 95d987ead..0e0ec4cff 100644
--- a/src/commandhandler.cpp
+++ b/src/commandhandler.cpp
@@ -1214,7 +1214,8 @@ void showRes(std::string str, ResourceManager::Resources *res)
debugChatTab->chatLog(str + toString(res->size()));
logger->log(str + toString(res->size()));
ResourceManager::ResourceIterator iter = res->begin();
- while (iter != res->end())
+ ResourceManager::ResourceIterator iter_end = res->end();
+ while (iter != iter_end)
{
if (iter->second && iter->second->getRefCount())
{
@@ -1311,9 +1312,8 @@ void CommandHandler::replaceVars(std::string &str)
StringVect names;
std::string newStr = "";
actorSpriteManager->getPlayerNames(names, false);
- StringVectCIter it = names.begin();
- StringVectCIter it_end = names.end();
- for (; it != it_end; ++ it)
+ for (StringVectCIter it = names.begin(), it_end = names.end();
+ it != it_end; ++ it)
{
if (*it != player_node->getName())
newStr += *it + ",";
@@ -1333,9 +1333,8 @@ void CommandHandler::replaceVars(std::string &str)
if (player_node->isInParty() && (party = player_node->getParty()))
{
party->getNames(names);
- StringVectCIter it = names.begin();
- StringVectCIter it_end = names.end();
- for (; it != it_end; ++ it)
+ for (StringVectCIter it = names.begin(), it_end = names.end();
+ it != it_end; ++ it)
{
if (*it != player_node->getName())
newStr += *it + ",";