[bit-page] Write get_population as dagger

This commit is contained in:
Behdad Esfahbod 2022-11-18 16:01:23 -07:00
parent 744eb6baf9
commit 87271e1b2e
1 changed files with 4 additions and 4 deletions

View File

@ -220,10 +220,10 @@ struct hb_bit_page_t
unsigned int get_population () const
{
unsigned int pop = 0;
for (unsigned int i = 0; i < len (); i++)
pop += hb_popcount (v[i]);
return pop;
return
+ hb_iter (v)
| hb_reduce ([] (unsigned pop, const elt_t &_) { return pop + hb_popcount (_); }, 0)
;
}
bool next (hb_codepoint_t *codepoint) const