From 999be72135a45f1e1e36b32d1944a6d6b7335f17 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 11 Jan 2023 11:21:17 -0700 Subject: [PATCH] [subset-plan] Simplify drop_tables allocation --- src/hb-subset-plan.cc | 2 +- src/hb-subset-plan.hh | 3 +-- src/hb-subset.cc | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/hb-subset-plan.cc b/src/hb-subset-plan.cc index f5e56ef86..0f8a27768 100644 --- a/src/hb-subset-plan.cc +++ b/src/hb-subset-plan.cc @@ -847,7 +847,7 @@ hb_subset_plan_create_or_fail (hb_face_t *face, plan->layout_features = *input->sets.layout_features; plan->layout_scripts = *input->sets.layout_scripts; plan->glyphs_requested = hb_set_copy (input->sets.glyphs); - plan->drop_tables = hb_set_copy (input->sets.drop_tables); + plan->drop_tables = *input->sets.drop_tables; plan->no_subset_tables = hb_set_copy (input->sets.no_subset_tables); plan->source = hb_face_reference (face); plan->dest = hb_face_builder_create (); diff --git a/src/hb-subset-plan.hh b/src/hb-subset-plan.hh index 76e9a5b84..1cc729785 100644 --- a/src/hb-subset-plan.hh +++ b/src/hb-subset-plan.hh @@ -50,7 +50,6 @@ struct hb_subset_plan_t { hb_set_destroy (unicodes); hb_set_destroy (glyphs_requested); - hb_set_destroy (drop_tables); hb_set_destroy (no_subset_tables); hb_face_destroy (source); hb_face_destroy (dest); @@ -114,7 +113,7 @@ struct hb_subset_plan_t hb_set_t *no_subset_tables; // Tables which should be dropped. - hb_set_t *drop_tables; + hb_set_t drop_tables; // The glyph subset hb_map_t *codepoint_to_glyph; diff --git a/src/hb-subset.cc b/src/hb-subset.cc index 0d56b13c9..4c47a46a9 100644 --- a/src/hb-subset.cc +++ b/src/hb-subset.cc @@ -355,7 +355,7 @@ _is_table_present (hb_face_t *source, hb_tag_t tag) static bool _should_drop_table (hb_subset_plan_t *plan, hb_tag_t tag) { - if (plan->drop_tables->has (tag)) + if (plan->drop_tables.has (tag)) return true; switch (tag)