mirror of
https://github.com/luau-lang/luau.git
synced 2025-04-10 22:00:54 +01:00
Probably should document this magic number.
This commit is contained in:
parent
f808ed2438
commit
f82e6d79a4
1 changed files with 4 additions and 2 deletions
|
@ -26,9 +26,11 @@ std::size_t languageHash(const T& lang) {
|
||||||
return LanguageHash<T>{}(lang);
|
return LanguageHash<T>{}(lang);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline size_t hashCombine(size_t& seed, size_t hash)
|
inline void hashCombine(size_t& seed, size_t hash)
|
||||||
{
|
{
|
||||||
return seed ^= hash + 0x9e3779b9 + (seed << 6) + (seed >> 2);
|
// Golden Ratio constant used for better hash scattering
|
||||||
|
// See https://softwareengineering.stackexchange.com/a/402543
|
||||||
|
seed ^= hash + 0x9e3779b9 + (seed << 6) + (seed >> 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define LUAU_EQSAT_ATOM(name, t) \
|
#define LUAU_EQSAT_ATOM(name, t) \
|
||||||
|
|
Loading…
Add table
Reference in a new issue