Skip to content

Commit

Permalink
libdeng2|Fixed: Address comparison must consider port as well
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Feb 12, 2013
1 parent 6fd78c8 commit 2b82cb7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion doomsday/libdeng2/src/net/address.cpp
Expand Up @@ -73,7 +73,12 @@ Address &Address::operator = (Address const &other)

bool Address::operator < (Address const &other) const
{
return d->host.toIPv4Address() < other.d->host.toIPv4Address();
quint32 const a = d->host.toIPv4Address();
quint32 const b = other.d->host.toIPv4Address();
if(a == b)
return d->port < other.d->port;
else
return a < b;
}

bool Address::operator == (Address const &other) const
Expand Down

0 comments on commit 2b82cb7

Please sign in to comment.