[subset] Optimize CoverageFormat2::intersected_coverage_glyphs

This commit is contained in:
Behdad Esfahbod 2022-05-18 13:38:29 -06:00
parent 6f37c20798
commit cf5001fac7
1 changed files with 4 additions and 2 deletions

View File

@ -1574,8 +1574,10 @@ struct CoverageFormat2
for (const auto& range : rangeRecord.as_array ())
{
if (!range.intersects (glyphs)) continue;
for (hb_codepoint_t g = range.first; g <= range.last; g++)
if (glyphs->has (g)) intersect_glyphs->add (g);
unsigned last = range.last;
for (hb_codepoint_t g = range.first - 1;
glyphs->next (&g) && g <= last;)
intersect_glyphs->add (g);
}
}