[map] Rewrite hash() as dagger

Somehow our daggers instead of for loop save size. I cannot
pinpoint why, other than maybe not inlining.
This commit is contained in:
Behdad Esfahbod 2022-11-18 16:39:30 -07:00
parent 025a68cb07
commit 4ec706980c
1 changed files with 4 additions and 4 deletions

View File

@ -250,10 +250,10 @@ struct hb_hashmap_t
uint32_t hash () const uint32_t hash () const
{ {
uint32_t h = 0; return
for (auto item : iter_items ()) + iter_items ()
h ^= item.total_hash (); | hb_reduce ([] (uint32_t h, const item_t &_) { return h ^ _.total_hash (); }, (uint32_t) 0u)
return h; ;
} }
bool is_equal (const hb_hashmap_t &other) const bool is_equal (const hb_hashmap_t &other) const