[array] Improve hash function
Previously all arrays of 0 bytes were getting same hash.
diff --git a/src/hb-array.hh b/src/hb-array.hh
index e82c081..6b539f2 100644
--- a/src/hb-array.hh
+++ b/src/hb-array.hh
@@ -122,7 +122,7 @@
uint32_t hash () const
{
- uint32_t current = 0;
+ uint32_t current = 7;
for (auto &v : *this)
current = current * 31 + hb_hash (v);
return current;
@@ -452,7 +452,7 @@
template <>
inline uint32_t hb_array_t<const char>::hash () const
{
- uint32_t current = 0;
+ uint32_t current = 7;
unsigned i = 0;
#if defined(__OPTIMIZE__) && !defined(HB_NO_PACKED) && \
@@ -470,7 +470,7 @@
template <>
inline uint32_t hb_array_t<const unsigned char>::hash () const
{
- uint32_t current = 0;
+ uint32_t current = 7;
unsigned i = 0;
#if defined(__OPTIMIZE__) && !defined(HB_NO_PACKED) && \