mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 23:47:23 -06:00
Delegate string hashing to standard library
Since standard library could have platform dependent specialized hashing functions. Also the main idea is to let `qHash` handle whatever integer type `std::hash` returns and mix it with `seed` accordingly. PR #18715.
This commit is contained in:
@@ -167,6 +167,6 @@ std::size_t qHash(const Digest32<N> &key, const std::size_t seed = 0)
|
||||
template <int N>
|
||||
uint qHash(const Digest32<N> &key, const uint seed = 0)
|
||||
{
|
||||
return static_cast<uint>((std::hash<typename Digest32<N>::UnderlyingType> {})(key)) ^ seed;
|
||||
return ::qHash(std::hash<typename Digest32<N>::UnderlyingType> {}(key), seed);
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user