From 60390169b65632406391f3492efdbd66c688555f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 9 May 2022 15:44:09 -0600 Subject: [PATCH] [cff-common] Write str_buf_t::total_size() as dagger --- src/hb-ot-cff-common.hh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/hb-ot-cff-common.hh b/src/hb-ot-cff-common.hh index 89f23b4b2..17641aa68 100644 --- a/src/hb-ot-cff-common.hh +++ b/src/hb-ot-cff-common.hh @@ -57,14 +57,11 @@ struct str_buff_vec_t : hb_vector_t { unsigned int total_size () const { - unsigned int size = 0; - for (const auto& v : *this ) - size += v.length; - return size; + return + this->iter () + | hb_map (&str_buff_t::length) + | hb_reduce (hb_add, 0) + ; } - - private: - typedef hb_vector_t SUPER; }; /* CFF INDEX */