From 531433248fbad49e2b8e9d90de9855f3ea9b2257 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 20 Jan 2013 19:01:23 +0300 Subject: Another part with FOR_EACH changes. --- src/gui/whoisonline.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'src/gui/whoisonline.cpp') diff --git a/src/gui/whoisonline.cpp b/src/gui/whoisonline.cpp index f0b0ab538..d7d67fbc2 100644 --- a/src/gui/whoisonline.cpp +++ b/src/gui/whoisonline.cpp @@ -139,11 +139,8 @@ WhoIsOnline::~WhoIsOnline() // Remove possibly leftover temporary download delete []mCurlError; - for (std::set::iterator itd = mOnlinePlayers.begin(), - itd_end = mOnlinePlayers.end(); itd != itd_end; ++ itd) - { + FOR_EACH (std::set::iterator, itd, mOnlinePlayers) delete *itd; - } mOnlinePlayers.clear(); mOnlineNicks.clear(); } @@ -247,18 +244,14 @@ void WhoIsOnline::loadList(std::vector &list) std::vector disregard; std::vector enemy; - for (std::set::iterator itd = mOnlinePlayers.begin(), - itd_end = mOnlinePlayers.end(); itd != itd_end; ++ itd) - { + FOR_EACH (std::set::iterator, itd, mOnlinePlayers) delete *itd; - } mOnlinePlayers.clear(); mOnlineNicks.clear(); mShowLevel = config.getBoolValue("showlevel"); - for (std::vector::const_iterator it = list.begin(), - it_end = list.end(); it != it_end; ++ it) + FOR_EACH (std::vector::const_iterator, it, list) { OnlinePlayer *player = *it; std::string nick = player->getNick(); @@ -335,11 +328,8 @@ void WhoIsOnline::loadWebList() char *line = strtok(mMemoryBuffer, "\n"); const std::string gmText = "(GM)"; - for (std::set::iterator itd = mOnlinePlayers.begin(), - itd_end = mOnlinePlayers.end(); itd != itd_end; ++ itd) - { + FOR_EACH (std::set::iterator, itd, mOnlinePlayers) delete *itd; - } mOnlinePlayers.clear(); mOnlineNicks.clear(); -- cgit v1.2.3-70-g09d2