[subset-plan] Simplify name_ids allocation

This commit is contained in:
Behdad Esfahbod 2023-01-11 10:47:40 -07:00
parent cfb48f91da
commit 78aa9f1e9c
2 changed files with 3 additions and 4 deletions

View File

@ -842,7 +842,7 @@ hb_subset_plan_create_or_fail (hb_face_t *face,
plan->unicode_to_new_gid_list.init (); plan->unicode_to_new_gid_list.init ();
plan->name_ids = hb_set_copy (input->sets.name_ids); plan->name_ids = *input->sets.name_ids;
plan->name_languages = *input->sets.name_languages; plan->name_languages = *input->sets.name_languages;
plan->layout_features = *input->sets.layout_features; plan->layout_features = *input->sets.layout_features;
plan->layout_scripts = *input->sets.layout_scripts; plan->layout_scripts = *input->sets.layout_scripts;
@ -952,7 +952,7 @@ hb_subset_plan_create_or_fail (hb_face_t *face,
plan->glyph_map->get(plan->unicode_to_new_gid_list.arrayZ[i].second); plan->glyph_map->get(plan->unicode_to_new_gid_list.arrayZ[i].second);
} }
_nameid_closure (face, plan->name_ids, plan->all_axes_pinned, plan->user_axes_location); _nameid_closure (face, &plan->name_ids, plan->all_axes_pinned, plan->user_axes_location);
if (unlikely (plan->in_error ())) { if (unlikely (plan->in_error ())) {
hb_subset_plan_destroy (plan); hb_subset_plan_destroy (plan);
return nullptr; return nullptr;

View File

@ -49,7 +49,6 @@ struct hb_subset_plan_t
~hb_subset_plan_t() ~hb_subset_plan_t()
{ {
hb_set_destroy (unicodes); hb_set_destroy (unicodes);
hb_set_destroy (name_ids);
hb_set_destroy (glyphs_requested); hb_set_destroy (glyphs_requested);
hb_set_destroy (drop_tables); hb_set_destroy (drop_tables);
hb_set_destroy (no_subset_tables); hb_set_destroy (no_subset_tables);
@ -115,7 +114,7 @@ struct hb_subset_plan_t
hb_sorted_vector_t<hb_pair_t<hb_codepoint_t, hb_codepoint_t>> unicode_to_new_gid_list; hb_sorted_vector_t<hb_pair_t<hb_codepoint_t, hb_codepoint_t>> unicode_to_new_gid_list;
// name_ids we would like to retain // name_ids we would like to retain
hb_set_t *name_ids; hb_set_t name_ids;
// name_languages we would like to retain // name_languages we would like to retain
hb_set_t name_languages; hb_set_t name_languages;