mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-14 17:13:40 +00:00
[hash] Use a Mersenne prime for int hash
And hope that compiler optimizes to int ops instead of modula. Improves chaining it seems. Part of https://github.com/harfbuzz/harfbuzz/pull/4228
This commit is contained in:
parent
fe0f7dc57b
commit
078b2a5101
1 changed files with 1 additions and 1 deletions
|
@ -316,7 +316,7 @@ struct
|
|||
|
||||
// Horrible: std:hash() of integers seems to be identity in gcc / clang?!
|
||||
template <typename T> constexpr auto
|
||||
impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, v * 2654435761u)
|
||||
impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, v * 8388607)
|
||||
|
||||
template <typename T> constexpr auto
|
||||
impl (const T& v, hb_priority<0>) const HB_RETURN (uint32_t, std::hash<hb_decay<decltype (hb_deref (v))>>{} (hb_deref (v)))
|
||||
|
|
Loading…
Add table
Reference in a new issue