From 81e2cccfde65ccf7588067bd3896fd5172b5079d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 11 May 2014 12:06:34 +0300 Subject: add anonimous namespace in guild. --- src/guild.cpp | 49 ++++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 23 deletions(-) (limited to 'src/guild.cpp') diff --git a/src/guild.cpp b/src/guild.cpp index 7ee97aaa9..c6411e774 100644 --- a/src/guild.cpp +++ b/src/guild.cpp @@ -28,32 +28,35 @@ #include "debug.h" -static class SortGuildFunctor final +namespace { - public: - bool operator() (const GuildMember *const m1, - const GuildMember *const m2) const - { - if (!m1 || !m2) - return false; - - if (m1->getOnline() != m2->getOnline()) - return m1->getOnline() > m2->getOnline(); - - if (m1->getPos() != m2->getPos()) - return m1->getPos() > m2->getPos(); - - if (m1->getName() != m2->getName()) + static class SortGuildFunctor final + { + public: + bool operator() (const GuildMember *const m1, + const GuildMember *const m2) const { - std::string s1 = m1->getName(); - std::string s2 = m2->getName(); - toLower(s1); - toLower(s2); - return s1 < s2; + if (!m1 || !m2) + return false; + + if (m1->getOnline() != m2->getOnline()) + return m1->getOnline() > m2->getOnline(); + + if (m1->getPos() != m2->getPos()) + return m1->getPos() > m2->getPos(); + + if (m1->getName() != m2->getName()) + { + std::string s1 = m1->getName(); + std::string s2 = m2->getName(); + toLower(s1); + toLower(s2); + return s1 < s2; + } + return false; } - return false; - } -} guildSorter; + } guildSorter; +} // namespace GuildMember::GuildMember(Guild *const guild, const int accountId, const int charId, const std::string &name): -- cgit v1.2.3-60-g2f50