From a07ad071563e924664cbf15e98557f9d4838062e Mon Sep 17 00:00:00 2001 From: Daniel De Graaf Date: Mon, 18 Apr 2011 16:58:35 -0400 Subject: [PATCH] Fix mis-implemented irc::sockets::cidr_mask::operator< --- src/socket.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/socket.cpp b/src/socket.cpp index a04523ddf..22c320b24 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -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 -- 2.39.5