From 8bfeea482838a0c4f678c7f666f4520f4f2e8dd9 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 5 May 2022 10:48:24 -0600 Subject: [PATCH] [subset] Compute set max using previous() --- src/hb-subset-plan.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/hb-subset-plan.cc b/src/hb-subset-plan.cc index b84478611..0a003d56f 100644 --- a/src/hb-subset-plan.cc +++ b/src/hb-subset-plan.cc @@ -442,10 +442,9 @@ _create_old_gid_to_new_gid_map (const hb_face_t *face, | hb_sink (reverse_glyph_map) ; - unsigned max_glyph = - + hb_iter (all_gids_to_retain) - | hb_reduce (hb_max, 0u) - ; + hb_codepoint_t max_glyph = HB_SET_VALUE_INVALID; + hb_set_previous (all_gids_to_retain, &max_glyph); + *num_glyphs = max_glyph + 1; }