[cff-common] Write str_buf_t::total_size() as dagger

This commit is contained in:
Behdad Esfahbod 2022-05-09 15:44:09 -06:00
parent 258afb45b7
commit 60390169b6
1 changed files with 4 additions and 7 deletions

View File

@ -57,14 +57,11 @@ struct str_buff_vec_t : hb_vector_t<str_buff_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<str_buff_t> SUPER;
};
/* CFF INDEX */