[hash] Switch to Knuth multiplicative hash

Wow, the old adhoc one was why the cmap test was timing out!
pull/4232/head
Behdad Esfahbod 2 years ago
parent 0270e3e974
commit 42f4dab8db
  1. 4
      src/hb-algs.hh

@ -326,11 +326,11 @@ struct
template <typename T,
hb_enable_if (std::is_integral<T>::value && sizeof (T) <= sizeof (uint32_t))> constexpr auto
impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, v * 131071u /* Mersenne prime */)
impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, v * 2654435761)
template <typename T,
hb_enable_if (std::is_integral<T>::value && sizeof (T) > sizeof (uint32_t))> constexpr auto
impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, (v ^ (v >> 32)) * 131071u /* Mersenne prime */)
impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, (v ^ (v >> 32)) * 2654435761)
#endif
template <typename T> constexpr auto

Loading…
Cancel
Save