[subset] Use del_range in _remove_invalid_gids

This commit is contained in:
Behdad Esfahbod 2022-05-05 10:19:16 -06:00
parent 2a42edccbe
commit 4fe69bc413
1 changed files with 2 additions and 7 deletions

View File

@ -279,12 +279,7 @@ static inline void
_remove_invalid_gids (hb_set_t *glyphs, _remove_invalid_gids (hb_set_t *glyphs,
unsigned int num_glyphs) unsigned int num_glyphs)
{ {
hb_codepoint_t gid = HB_SET_VALUE_INVALID; glyphs->del_range (num_glyphs, HB_SET_VALUE_INVALID);
while (glyphs->next (&gid))
{
if (gid >= num_glyphs)
glyphs->del (gid);
}
} }
static void static void
@ -400,7 +395,7 @@ _populate_gids_to_retain (hb_subset_plan_t* plan,
hb_set_set (plan->_glyphset_colred, &cur_glyphset); hb_set_set (plan->_glyphset_colred, &cur_glyphset);
// Populate a full set of glyphs to retain by adding all referenced // Populate a full set of glyphs to retain by adding all referenced
// composite glyphs. // composite glyphs.
for (hb_codepoint_t gid : cur_glyphset.iter ()) for (hb_codepoint_t gid : cur_glyphset)
{ {
glyf.add_gid_and_children (gid, plan->_glyphset); glyf.add_gid_and_children (gid, plan->_glyphset);
#ifndef HB_NO_SUBSET_CFF #ifndef HB_NO_SUBSET_CFF