From 1fbb08584b172553651a7842ec9ee977991c93c7 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 9 May 2023 17:11:05 -0600 Subject: [PATCH] [hash] Adjust prime number Previous one wasn't a prime. Ouch! --- src/hb-algs.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hb-algs.hh b/src/hb-algs.hh index 14a1ac55a..e8ce0a36c 100644 --- a/src/hb-algs.hh +++ b/src/hb-algs.hh @@ -319,11 +319,11 @@ struct template ::value && sizeof (T) <= sizeof (uint32_t))> constexpr auto - impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, v * 8388607u /* Mersenne prime */) + impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, v * 131071u /* Mersenne prime */) template ::value && sizeof (T) > sizeof (uint32_t))> constexpr auto - impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, (v ^ (v >> 32)) * 8388607u /* Mersenne prime */) + impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, (v ^ (v >> 32)) * 131071u /* Mersenne prime */) template constexpr auto impl (const T& v, hb_priority<0>) const HB_RETURN (uint32_t, std::hash>{} (hb_deref (v)))