From 4fe69bc41327596af540a2f683062b41a4f37f45 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 5 May 2022 10:19:16 -0600 Subject: [PATCH] [subset] Use del_range in _remove_invalid_gids --- src/hb-subset-plan.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/hb-subset-plan.cc b/src/hb-subset-plan.cc index 630c08b6b..0b11b6042 100644 --- a/src/hb-subset-plan.cc +++ b/src/hb-subset-plan.cc @@ -279,12 +279,7 @@ static inline void _remove_invalid_gids (hb_set_t *glyphs, unsigned int num_glyphs) { - hb_codepoint_t gid = HB_SET_VALUE_INVALID; - while (glyphs->next (&gid)) - { - if (gid >= num_glyphs) - glyphs->del (gid); - } + glyphs->del_range (num_glyphs, HB_SET_VALUE_INVALID); } static void @@ -400,7 +395,7 @@ _populate_gids_to_retain (hb_subset_plan_t* plan, hb_set_set (plan->_glyphset_colred, &cur_glyphset); // Populate a full set of glyphs to retain by adding all referenced // 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); #ifndef HB_NO_SUBSET_CFF