[subset/SingleSubsetFormat1] Use Coverage.intersect_set
This commit is contained in:
parent
00dfbbce1c
commit
efa388074d
|
@ -44,11 +44,7 @@ struct SingleSubstFormat1_3
|
||||||
|
|
||||||
if (1)
|
if (1)
|
||||||
{
|
{
|
||||||
/* Walk the coverage and set together, to bail out when the
|
/* Somehow this branch is much faster. Can't understand why. */
|
||||||
* coverage iterator runs over the end of glyphset. Otherwise,
|
|
||||||
* the coverage may cover many glyphs and we spend a lot of
|
|
||||||
* time here. Other subtables don't have this problem because
|
|
||||||
* they zip coverage iterator with some array... */
|
|
||||||
auto c_iter = hb_iter (this+coverage);
|
auto c_iter = hb_iter (this+coverage);
|
||||||
auto s_iter = hb_iter (c->parent_active_glyphs ());
|
auto s_iter = hb_iter (c->parent_active_glyphs ());
|
||||||
while (c_iter && s_iter)
|
while (c_iter && s_iter)
|
||||||
|
@ -69,8 +65,10 @@ struct SingleSubstFormat1_3
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
+ hb_iter (this+coverage)
|
hb_set_t intersection;
|
||||||
| hb_filter (c->parent_active_glyphs ())
|
(this+coverage).intersect_set (c->parent_active_glyphs (), intersection);
|
||||||
|
|
||||||
|
+ hb_iter (intersection)
|
||||||
| hb_map ([d, mask] (hb_codepoint_t g) { return (g + d) & mask; })
|
| hb_map ([d, mask] (hb_codepoint_t g) { return (g + d) & mask; })
|
||||||
| hb_sink (c->output)
|
| hb_sink (c->output)
|
||||||
;
|
;
|
||||||
|
|
Loading…
Reference in New Issue