From 238cb0fbfd6f7143ad718c7aa488c30865f253fd Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 5 Jun 2023 13:27:03 -0600 Subject: [PATCH] [subset/cff1] Speed up for retaingids --- src/hb-subset-cff1.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/hb-subset-cff1.cc b/src/hb-subset-cff1.cc index d9add1b8e..d997c5b66 100644 --- a/src/hb-subset-cff1.cc +++ b/src/hb-subset-cff1.cc @@ -584,11 +584,10 @@ struct cff_subset_plan { /* check whether the subset renumbers any glyph IDs */ gid_renum = false; - for (hb_codepoint_t new_glyph = 0; new_glyph < num_glyphs; new_glyph++) + for (const auto &_ : plan->new_to_old_gid_list) { - if (!plan->old_gid_for_new_gid(new_glyph, &old_glyph)) - continue; - if (new_glyph != old_glyph) { + if (_.first != _.second) + { gid_renum = true; break; }