1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 16:51:15 +02:00

Merge pull request #11092 from DeterminateSystems/hash-SourcePath

Use std::unordered_map for the EvalState caches
This commit is contained in:
Eelco Dolstra 2024-07-16 11:06:43 +02:00 committed by GitHub
commit 9c6678da0e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 37 additions and 8 deletions

View file

@ -375,4 +375,18 @@ inline std::string operator + (std::string_view s1, const char * s2)
return s;
}
/**
* hash_combine() from Boost. Hash several hashable values together
* into a single hash.
*/
inline void hash_combine(std::size_t & seed) { }
template <typename T, typename... Rest>
inline void hash_combine(std::size_t & seed, const T & v, Rest... rest)
{
std::hash<T> hasher;
seed ^= hasher(v) + 0x9e3779b9 + (seed<<6) + (seed>>2);
hash_combine(seed, rest...);
}
}