From 1d91622ddf082cd0777e9ae67876fe13fc7e454d Mon Sep 17 00:00:00 2001 From: Qunxin Liu Date: Tue, 18 Jul 2023 09:52:40 -0700 Subject: [PATCH] [instancer] add a hashing impl for floating point type --- src/hb-algs.hh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hb-algs.hh b/src/hb-algs.hh index 6cabc7fb0..ea9705716 100644 --- a/src/hb-algs.hh +++ b/src/hb-algs.hh @@ -367,6 +367,10 @@ struct hb_enable_if (std::is_integral::value && sizeof (T) > sizeof (uint32_t))> constexpr auto impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, (uint32_t) (v ^ (v >> 32)) * 2654435761u /* Knuth's multiplicative hash */) + template ::value)> constexpr auto + impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, fasthash32 (std::addressof (v), sizeof (T), 0xf437ffe6)) + template constexpr auto impl (const T& v, hb_priority<0>) const HB_RETURN (uint32_t, std::hash>{} (hb_deref (v)))