From 4ec706980c9f5583b9c6db2862b9603bba284055 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 18 Nov 2022 16:39:30 -0700 Subject: [PATCH] [map] Rewrite hash() as dagger Somehow our daggers instead of for loop save size. I cannot pinpoint why, other than maybe not inlining. --- src/hb-map.hh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hb-map.hh b/src/hb-map.hh index f8e3fab05..3929b07cc 100644 --- a/src/hb-map.hh +++ b/src/hb-map.hh @@ -250,10 +250,10 @@ struct hb_hashmap_t uint32_t hash () const { - uint32_t h = 0; - for (auto item : iter_items ()) - h ^= item.total_hash (); - return h; + return + + iter_items () + | hb_reduce ([] (uint32_t h, const item_t &_) { return h ^ _.total_hash (); }, (uint32_t) 0u) + ; } bool is_equal (const hb_hashmap_t &other) const