From ae578705c2ac7f8d520ff5f6646c2efe57469902 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 22 Nov 2022 12:23:17 -0700 Subject: [PATCH] [array] Write hash as range for loop again Now that our range loop is faster than our own iter. --- src/hb-array.hh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hb-array.hh b/src/hb-array.hh index 562f03cdf..fe1639a84 100644 --- a/src/hb-array.hh +++ b/src/hb-array.hh @@ -119,10 +119,10 @@ struct hb_array_t : hb_iter_with_fallback_t, 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; } /*