From a69a87c5a81ddbf25a25c5549259da550d207bda Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 23 Jun 2012 02:46:01 +0300 Subject: Improve a bit iterators again. --- src/net/manaserv/attributes.cpp | 15 ++++++++------- src/net/manaserv/charhandler.cpp | 6 ++++-- 2 files changed, 12 insertions(+), 9 deletions(-) (limited to 'src/net') diff --git a/src/net/manaserv/attributes.cpp b/src/net/manaserv/attributes.cpp index 47eb5b253..a03e510fb 100644 --- a/src/net/manaserv/attributes.cpp +++ b/src/net/manaserv/attributes.cpp @@ -92,8 +92,8 @@ namespace Attributes { // Fill up the modifiable attribute label list. attributeLabels.clear(); - AttributeMap::const_iterator it, it_end; - for (it = attributes.begin(), it_end = attributes.end(); + for (AttributeMap::const_iterator it = attributes.begin(), + it_end = attributes.end(); it != it_end; ++it) { if (it->second.modifiable && (it->second.scope == "character" @@ -383,10 +383,11 @@ namespace Attributes { std::vector dbStats; - TagMap::const_iterator it, it_end; - for (it = tags.begin(), it_end = tags.end(); it != it_end; ++it) + for (TagMap::const_iterator it = tags.begin(), it_end = tags.end(); + it != it_end; ++it) + { dbStats.push_back(ItemDB::Stat(it->first, it->second)); - + } ItemDB::setStatsList(dbStats); } @@ -395,8 +396,8 @@ namespace Attributes if (!statusWindow) return; - AttributeMap::const_iterator it, it_end; - for (it = attributes.begin(), it_end = attributes.end(); + for (AttributeMap::const_iterator it = attributes.begin(), + it_end = attributes.end(); it != it_end; ++it) { if (it->second.playerInfoId == -1 diff --git a/src/net/manaserv/charhandler.cpp b/src/net/manaserv/charhandler.cpp index f1af32354..7878e5d88 100644 --- a/src/net/manaserv/charhandler.cpp +++ b/src/net/manaserv/charhandler.cpp @@ -323,9 +323,11 @@ void CharHandler::newCharacter(const std::string &name, msg.writeInt8(gender); msg.writeInt8(slot); - std::vector::const_iterator it, it_end; - for (it = stats.begin(), it_end = stats.end(); it != it_end; ++it) + for (std::vector::const_iterator it = stats.begin(), + it_end = stats.end(); it != it_end; ++it) + { msg.writeInt16((*it)); + } accountServerConnection->send(msg); } -- cgit v1.2.3-70-g09d2