[gsubgpos] Clean up OT::ClassDefFormat2::intersected_class_glyphs 0 case

This commit is contained in:
Behdad Esfahbod 2022-05-11 13:47:17 -06:00
parent 137af3612b
commit 175319cd89
1 changed files with 10 additions and 8 deletions

View File

@ -2295,17 +2295,19 @@ struct ClassDefFormat2
hb_codepoint_t g = HB_SET_VALUE_INVALID; hb_codepoint_t g = HB_SET_VALUE_INVALID;
for (unsigned int i = 0; i < count; i++) for (unsigned int i = 0; i < count; i++)
{ {
if (!hb_set_next (glyphs, &g)) if (!hb_set_next (glyphs, &g))
break; goto done;
while (g != HB_SET_VALUE_INVALID && g < rangeRecord[i].first) while (g < rangeRecord[i].first)
{ {
intersect_glyphs->add (g); intersect_glyphs->add (g);
hb_set_next (glyphs, &g); if (!hb_set_next (glyphs, &g))
goto done;
} }
g = rangeRecord[i].last; g = rangeRecord[i].last;
} }
while (g != HB_SET_VALUE_INVALID && hb_set_next (glyphs, &g)) while (hb_set_next (glyphs, &g))
intersect_glyphs->add (g); intersect_glyphs->add (g);
done:
return; return;
} }