From 55679ae1ac8fad893a5f40fe034474423d96d21d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 11 May 2014 17:18:44 +0300 Subject: Add anonumous namespace into party. --- src/party.cpp | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/src/party.cpp b/src/party.cpp index 2e3bf6fac..8b004883f 100644 --- a/src/party.cpp +++ b/src/party.cpp @@ -27,30 +27,33 @@ #include "debug.h" -static class SortPartyFunctor final +namespace { - public: - bool operator() (const PartyMember *const p1, - const PartyMember *const p2) const - { - if (!p1 || !p2) - return false; - if (p1->getLeader()) - return true; - if (p2->getLeader()) - return false; - - if (p1->getName() != p2->getName()) + static class SortPartyFunctor final + { + public: + bool operator() (const PartyMember *const p1, + const PartyMember *const p2) const { - std::string s1 = p1->getName(); - std::string s2 = p2->getName(); - toLower(s1); - toLower(s2); - return s1 < s2; + if (!p1 || !p2) + return false; + if (p1->getLeader()) + return true; + if (p2->getLeader()) + return false; + + if (p1->getName() != p2->getName()) + { + std::string s1 = p1->getName(); + std::string s2 = p2->getName(); + toLower(s1); + toLower(s2); + return s1 < s2; + } + return false; } - return false; - } -} partySorter; + } partySorter; +} // namespace PartyMember::PartyMember(Party *const party, const int id, const std::string &name) : -- cgit v1.2.3-70-g09d2