[array] Write hash as range for loop again

Now that our range loop is faster than our own iter.
This commit is contained in:
Behdad Esfahbod 2022-11-22 12:23:17 -07:00
parent 13e1ca9eb5
commit ae578705c2
1 changed files with 4 additions and 4 deletions

View File

@ -119,10 +119,10 @@ struct hb_array_t : hb_iter_with_fallback_t<hb_array_t<Type>, Type&>
uint32_t hash () const uint32_t hash () const
{ {
return uint32_t current = 0;
+ hb_iter (*this) for (auto &v : *this)
| hb_reduce ([] (uint32_t h, const Type &_) { return h * 31 + hb_hash (_); }, (uint32_t) 0u) current = current * 31 + hb_hash (v);
; return current;
} }
/* /*