]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix mis-implemented irc::sockets::cidr_mask::operator<
authorDaniel De Graaf <danieldg@inspircd.org>
Mon, 18 Apr 2011 20:58:35 +0000 (16:58 -0400)
committerDaniel De Graaf <danieldg@inspircd.org>
Mon, 18 Apr 2011 20:58:42 +0000 (16:58 -0400)
src/socket.cpp

index a04523ddf0b68c6bf814fd04a5a3df539374ad1c..22c320b24d7c6baa1d1f9972674a7ce5d7ef2875 100644 (file)
@@ -338,8 +338,11 @@ bool irc::sockets::cidr_mask::operator==(const cidr_mask& other) const
 
 bool irc::sockets::cidr_mask::operator<(const cidr_mask& other) const
 {
-       return type < other.type || length < other.length ||
-               memcmp(bits, other.bits, 16) < 0;
+       if (type != other.type)
+               return type < other.type;
+       if (length != other.length)
+               return length < other.length;
+       return memcmp(bits, other.bits, 16) < 0;
 }
 
 bool irc::sockets::cidr_mask::match(const irc::sockets::sockaddrs& addr) const