[subset-plan] Simplify no_subset_tables allocation

This commit is contained in:
Behdad Esfahbod 2023-01-11 11:22:22 -07:00
parent 999be72135
commit c51d33685d
3 changed files with 5 additions and 6 deletions

View File

@ -848,7 +848,7 @@ hb_subset_plan_create_or_fail (hb_face_t *face,
plan->layout_scripts = *input->sets.layout_scripts;
plan->glyphs_requested = hb_set_copy (input->sets.glyphs);
plan->drop_tables = *input->sets.drop_tables;
plan->no_subset_tables = hb_set_copy (input->sets.no_subset_tables);
plan->no_subset_tables = *input->sets.no_subset_tables;
plan->source = hb_face_reference (face);
plan->dest = hb_face_builder_create ();

View File

@ -50,7 +50,6 @@ struct hb_subset_plan_t
{
hb_set_destroy (unicodes);
hb_set_destroy (glyphs_requested);
hb_set_destroy (no_subset_tables);
hb_face_destroy (source);
hb_face_destroy (dest);
hb_map_destroy (codepoint_to_glyph);
@ -110,7 +109,7 @@ struct hb_subset_plan_t
hb_set_t *glyphs_requested;
// Tables which should not be processed, just pass them through.
hb_set_t *no_subset_tables;
hb_set_t no_subset_tables;
// Tables which should be dropped.
hb_set_t drop_tables;

View File

@ -168,11 +168,11 @@ _get_table_tags (const hb_subset_plan_t* plan,
hb_concat (
+ hb_array (known_tables)
| hb_filter ([&] (hb_tag_t tag) {
return !_table_is_empty (plan->source, tag) && !plan->no_subset_tables->has (tag);
return !_table_is_empty (plan->source, tag) && !plan->no_subset_tables.has (tag);
})
| hb_map ([] (hb_tag_t tag) -> hb_tag_t { return tag; }),
plan->no_subset_tables->iter ()
plan->no_subset_tables.iter ()
| hb_filter([&] (hb_tag_t tag) {
return !_table_is_empty (plan->source, tag);
}));
@ -424,7 +424,7 @@ _subset_table (hb_subset_plan_t *plan,
hb_vector_t<char> &buf,
hb_tag_t tag)
{
if (plan->no_subset_tables->has (tag)) {
if (plan->no_subset_tables.has (tag)) {
return _passthrough (plan, tag);
}