mirror of
https://github.com/monero-project/monero.git
synced 2025-08-04 05:34:14 -04:00
net: fix incorrect less operator for top/i2p addresses
This commit is contained in:
parent
51873fec04
commit
d0641b42fe
3 changed files with 406 additions and 24 deletions
|
@ -171,7 +171,8 @@ namespace net
|
|||
|
||||
bool i2p_address::less(const i2p_address& rhs) const noexcept
|
||||
{
|
||||
return std::strcmp(host_str(), rhs.host_str()) < 0 || port() < rhs.port();
|
||||
int res = std::strcmp(host_str(), rhs.host_str());
|
||||
return res < 0 || (res == 0 && port() < rhs.port());
|
||||
}
|
||||
|
||||
bool i2p_address::is_same_host(const i2p_address& rhs) const noexcept
|
||||
|
|
|
@ -173,7 +173,8 @@ namespace net
|
|||
|
||||
bool tor_address::less(const tor_address& rhs) const noexcept
|
||||
{
|
||||
return std::strcmp(host_str(), rhs.host_str()) < 0 || port() < rhs.port();
|
||||
int res = std::strcmp(host_str(), rhs.host_str());
|
||||
return res < 0 || (res == 0 && port() < rhs.port());
|
||||
}
|
||||
|
||||
bool tor_address::is_same_host(const tor_address& rhs) const noexcept
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue