mirror of
https://github.com/monero-project/monero.git
synced 2025-08-02 19:06:10 -04:00
Merge pull request #6285
d0641b42
net: fix incorrect less operator for top/i2p addresses (Aaron Hook)
This commit is contained in:
commit
7d4a93fab3
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