diff options
Diffstat (limited to 'src/gui/windows/whoisonline.cpp')
-rw-r--r-- | src/gui/windows/whoisonline.cpp | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp index ca939df47..2cb1c1e16 100644 --- a/src/gui/windows/whoisonline.cpp +++ b/src/gui/windows/whoisonline.cpp @@ -62,6 +62,7 @@ #include "utils/foreach.h" #include "utils/gettext.h" +#include "utils/performance.h" #include "utils/sdlhelper.h" #ifdef TMWA_SUPPORT @@ -250,33 +251,22 @@ void WhoIsOnline::updateWindow(size_t numOnline) std::sort(mFriends.begin(), mFriends.end(), nameCompare); std::sort(mNeutral.begin(), mNeutral.end(), nameCompare); std::sort(mDisregard.begin(), mDisregard.end(), nameCompare); - bool addedFromSection(false); FOR_EACH (STD_VECTOR<OnlinePlayer*>::const_iterator, it, mFriends) - { mBrowserBox->addRow((*it)->getText(), false); - addedFromSection = true; - } - if (addedFromSection == true) - { + + if (!mFriends.empty()) mBrowserBox->addRow("---", false); - addedFromSection = false; - } + FOR_EACH (STD_VECTOR<OnlinePlayer*>::const_iterator, it, mEnemy) - { mBrowserBox->addRow((*it)->getText(), false); - addedFromSection = true; - } - if (addedFromSection == true) - { + + if (!mEnemy.empty()) mBrowserBox->addRow("---", false); - addedFromSection = false; - } + FOR_EACH (STD_VECTOR<OnlinePlayer*>::const_iterator, it, mNeutral) - { mBrowserBox->addRow((*it)->getText(), false); - addedFromSection = true; - } - if (addedFromSection == true && !mDisregard.empty()) + + if (!mNeutral.empty() && !mDisregard.empty()) mBrowserBox->addRow("---", false); FOR_EACH (STD_VECTOR<OnlinePlayer*>::const_iterator, it, mDisregard) |