mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-14 17:13:40 +00:00
Revert "[hash] Use fasthash for integer hash"
This reverts commit 3bf758a57071572a0ffae3c359b4cfec5a096312. This was resulting in long chains again :(.
This commit is contained in:
parent
bdaa74d25f
commit
05567da082
1 changed files with 2 additions and 8 deletions
|
@ -307,12 +307,6 @@ static inline uint32_t fasthash32(const void *buf, size_t len, uint32_t seed)
|
|||
return h - (h >> 32);
|
||||
}
|
||||
|
||||
template <typename T> // This line speeds things up. Go figure...
|
||||
static inline uint32_t _hb_hash32 (uint32_t v)
|
||||
{
|
||||
return fasthash32 (&v, sizeof (v), 0);
|
||||
}
|
||||
|
||||
struct
|
||||
{
|
||||
private:
|
||||
|
@ -324,11 +318,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, _hb_hash32 (v))
|
||||
impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, v * 8388607u /* Mersenne prime */)
|
||||
|
||||
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, _hb_hash32 (v) ^ _hb_hash32 (v >> 32))
|
||||
impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, (v * 8388607u) ^ ((v >> 32) * 8388607u) /* Mersenne prime */)
|
||||
|
||||
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