[bit-page] Write hash() as dagger
This commit is contained in:
parent
87271e1b2e
commit
68a29020c5
|
@ -94,10 +94,10 @@ struct hb_bit_page_t
|
||||||
}
|
}
|
||||||
uint32_t hash () const
|
uint32_t hash () const
|
||||||
{
|
{
|
||||||
uint32_t h = 0;
|
return
|
||||||
for (unsigned i = 0; i < len (); i++)
|
+ hb_iter (v)
|
||||||
h = h * 31 + hb_hash (v[i]);
|
| hb_reduce ([] (uint32_t h, const elt_t &_) { return h * 31 + hb_hash (_); }, (uint32_t) 0u)
|
||||||
return h;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
void add (hb_codepoint_t g) { elt (g) |= mask (g); }
|
void add (hb_codepoint_t g) { elt (g) |= mask (g); }
|
||||||
|
@ -222,7 +222,7 @@ struct hb_bit_page_t
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
+ hb_iter (v)
|
+ hb_iter (v)
|
||||||
| hb_reduce ([] (unsigned pop, const elt_t &_) { return pop + hb_popcount (_); }, 0)
|
| hb_reduce ([] (unsigned pop, const elt_t &_) { return pop + hb_popcount (_); }, 0u)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue