mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-12-01 10:34:23 +01:00
[bit-page] Write hash() as dagger
This commit is contained in:
1 parent
87271e1b2e
commit
68a29020c5
1 file changed
+5
-5
+5
-5
@@ -94,10 +94,10 @@ struct hb_bit_page_t
|
||||
}
|
||||
uint32_t hash () const
|
||||
{
|
||||
uint32_t h = 0;
|
||||
for (unsigned i = 0; i < len (); i++)
|
||||
h = h * 31 + hb_hash (v[i]);
|
||||
return h;
|
||||
return
|
||||
+ hb_iter (v)
|
||||
| hb_reduce ([] (uint32_t h, const elt_t &_) { return h * 31 + hb_hash (_); }, (uint32_t) 0u)
|
||||
;
|
||||
}
|
||||
|
||||
void add (hb_codepoint_t g) { elt (g) |= mask (g); }
|
||||
@@ -222,7 +222,7 @@ struct hb_bit_page_t
|
||||
{
|
||||
return
|
||||
+ 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)
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user