[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 get_population () const
{ {
unsigned int pop = 0; return
for (unsigned int i = 0; i < len (); i++) + hb_iter (v)
pop += hb_popcount (v[i]); | hb_reduce ([] (unsigned pop, const elt_t &_) { return pop + hb_popcount (_); }, 0)
return pop; ;
} }
bool next (hb_codepoint_t *codepoint) const bool next (hb_codepoint_t *codepoint) const