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:
Chocobo1
2022-03-12 21:40:58 +08:00
parent 926d51839f
commit b3fb6bd990
3 changed files with 14 additions and 14 deletions

View File

@@ -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)