[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
{
return
+ hb_iter (*this)
| hb_reduce ([] (uint32_t h, const Type &_) { return h * 31 + hb_hash (_); }, (uint32_t) 0u)
;
uint32_t current = 0;
for (auto &v : *this)
current = current * 31 + hb_hash (v);
return current;
}
/*