[subset] Optimize ClassDef1::intersected_class_glyphs() for class0

This commit is contained in:
Behdad Esfahbod 2022-05-11 13:16:31 -06:00
parent c78d8ba60b
commit 3261e05bdb
1 changed files with 7 additions and 4 deletions

View File

@ -2057,10 +2057,13 @@ struct ClassDefFormat1
unsigned count = classValue.len;
if (klass == 0)
{
hb_codepoint_t endGlyph = startGlyph + count -1;
for (hb_codepoint_t g : glyphs->iter ())
if (g < startGlyph || g > endGlyph)
intersect_glyphs->add (g);
for (unsigned g = HB_SET_VALUE_INVALID;
hb_set_next (glyphs, &g) && g < startGlyph;)
intersect_glyphs->add (g);
for (unsigned g = startGlyph + count - 1;
hb_set_next (glyphs, &g);)
intersect_glyphs->add (g);
return;
}