[array] Use dagger for hashing array
Also switch to better mixing.
This commit is contained in:
parent
b6f29bf141
commit
d0da547b37
|
@ -278,10 +278,11 @@ hb_sorted_array (T (&array_)[length_])
|
||||||
template <typename T>
|
template <typename T>
|
||||||
uint32_t hb_array_t<T>::hash () const
|
uint32_t hb_array_t<T>::hash () const
|
||||||
{
|
{
|
||||||
uint32_t h = 0;
|
return
|
||||||
for (unsigned i = 0; i < length; i++)
|
+ hb_iter (this)
|
||||||
h ^= hb_hash (arrayZ[i]);
|
| hb_map (hb_hash)
|
||||||
return h;
|
| hb_reduce ([] (uint32_t a, uint32_t b) -> uint32_t { return a * 31 + b; }, 0)
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef hb_array_t<const char> hb_bytes_t;
|
typedef hb_array_t<const char> hb_bytes_t;
|
||||||
|
|
Loading…
Reference in New Issue