mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-21 16:07:23 -06:00
Avoid redundant hashing
The return type of `std::hash()` is larger (or equal) than what `qHash()` requires so we can omit hashing it again.
This commit is contained in:
@@ -96,7 +96,7 @@ std::size_t BitTorrent::qHash(const BitTorrent::TorrentID &key, const std::size_
|
||||
uint BitTorrent::qHash(const BitTorrent::TorrentID &key, const uint seed)
|
||||
#endif
|
||||
{
|
||||
return ::qHash(std::hash<TorrentID::UnderlyingType>()(key), seed);
|
||||
return ::qHash(static_cast<TorrentID::BaseType>(key), seed);
|
||||
}
|
||||
|
||||
bool BitTorrent::operator==(const BitTorrent::InfoHash &left, const BitTorrent::InfoHash &right)
|
||||
|
||||
Reference in New Issue
Block a user