Removed unused function banned_compare_subnet::set_use_subnet_mask.

This commit is contained in:
Guillaume Melquiond 2010-10-30 09:40:30 +00:00
parent d098312cfe
commit 001f868d21
2 changed files with 0 additions and 21 deletions

View File

@ -52,20 +52,6 @@ static lg::log_domain log_server("server");
banned_compare_subnet::compare_fn banned_compare_subnet::active_ = &banned_compare_subnet::less;
void banned_compare_subnet::set_use_subnet_mask(bool use)
{
if (use)
{
assert(active_ == &banned_compare_subnet::less);
active_ = &banned_compare_subnet::less_with_subnet;
}
else
{
assert(active_ != &banned_compare_subnet::less);
active_ = &banned_compare_subnet::less;
}
}
bool banned_compare_subnet::operator()(const banned_ptr& a, const banned_ptr& b) const
{
return (this->*(active_))(a,b);
@ -76,11 +62,6 @@ static lg::log_domain log_server("server");
return a->get_int_ip() < b->get_int_ip();
}
bool banned_compare_subnet::less_with_subnet(const banned_ptr& a, const banned_ptr& b) const
{
return a->get_mask_ip(b->mask()) < b->get_mask_ip(a->mask());
}
const std::string banned::who_banned_default_ = "system";
banned_ptr banned::create_dummy(const std::string& ip)

View File

@ -43,9 +43,7 @@ namespace wesnothd {
struct banned_compare_subnet {
bool operator()(const banned_ptr& a, const banned_ptr& b) const;
private:
static void set_use_subnet_mask(bool);
bool less(const banned_ptr& a, const banned_ptr& b) const;
bool less_with_subnet(const banned_ptr& a, const banned_ptr& b) const;
typedef bool (banned_compare_subnet::*compare_fn)(const banned_ptr& a, const banned_ptr& b) const;
static compare_fn active_;
};