diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-11 12:06:34 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-11 12:06:34 +0300 |
commit | 81e2cccfde65ccf7588067bd3896fd5172b5079d (patch) | |
tree | 94303d63827024522697e072ad9881cc1776cf65 /src | |
parent | 928145e71e073842c7e8947eda7e56050229b5f2 (diff) | |
download | manaverse-81e2cccfde65ccf7588067bd3896fd5172b5079d.tar.gz manaverse-81e2cccfde65ccf7588067bd3896fd5172b5079d.tar.bz2 manaverse-81e2cccfde65ccf7588067bd3896fd5172b5079d.tar.xz manaverse-81e2cccfde65ccf7588067bd3896fd5172b5079d.zip |
add anonimous namespace in guild.
Diffstat (limited to 'src')
-rw-r--r-- | src/guild.cpp | 49 |
1 files changed, 26 insertions, 23 deletions
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): |