summaryrefslogtreecommitdiff
path: root/modules/chanserv/access.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2017-04-06 12:22:52 -0400
committerAdam <Adam@anope.org>2017-04-06 12:22:52 -0400
commit72bb1b14d372fa6065af77e8b98e8aab5295fe23 (patch)
treed0e426a88a64b67ba832fcd4648ec1d6f198fc42 /modules/chanserv/access.cpp
parent7f5cb607af73a4134a158a14006bdc3e202d0a34 (diff)
Fix access comparison operators
Diffstat (limited to 'modules/chanserv/access.cpp')
-rw-r--r--modules/chanserv/access.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/modules/chanserv/access.cpp b/modules/chanserv/access.cpp
index a29524a73..8342e5973 100644
--- a/modules/chanserv/access.cpp
+++ b/modules/chanserv/access.cpp
@@ -60,20 +60,20 @@ class AccessChanAccessImpl : public AccessChanAccess
}
}
- bool operator>(ChanServ::ChanAccess &other) override
+ int Compare(ChanAccess *other) override
{
- if (this->GetSerializableType() != other.GetSerializableType())
- return ChanServ::ChanAccess::operator>(other);
- else
- return this->GetLevel() > anope_dynamic_static_cast<AccessChanAccess *>(&other)->GetLevel();
- }
+ if (this->GetSerializableType() != other->GetSerializableType())
+ return ChanAccess::Compare(other);
- bool operator<(ChanServ::ChanAccess &other) override
- {
- if (this->GetSerializableType() != other.GetSerializableType())
- return ChanAccess::operator<(other);
+ int lev = this->GetLevel();
+ int theirlev = anope_dynamic_static_cast<AccessChanAccess *>(other)->GetLevel();
+
+ if (lev > theirlev)
+ return 1;
+ else if (lev < theirlev)
+ return -1;
else
- return this->GetLevel() < anope_dynamic_static_cast<AccessChanAccess *>(&other)->GetLevel();
+ return 0;
}
};