From de2cef42b4b6fba68d5b7baa53019af257ba2110 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 18 Jan 2022 09:21:31 -0700 Subject: [PATCH] [bimap] Remove init/fini --- src/hb-bimap.hh | 14 -------------- src/hb-ot-layout-common.hh | 9 --------- src/hb-ot-var-hvar-table.hh | 7 ++----- src/hb-subset-cff-common.hh | 19 +------------------ src/hb-subset-cff1.cc | 8 -------- src/hb-subset-cff2.cc | 2 -- 6 files changed, 3 insertions(+), 56 deletions(-) diff --git a/src/hb-bimap.hh b/src/hb-bimap.hh index d466af8b6..a9e1278de 100644 --- a/src/hb-bimap.hh +++ b/src/hb-bimap.hh @@ -33,20 +33,6 @@ /* Bi-directional map */ struct hb_bimap_t { - /* XXX(remove) */ - void init () - { - forw_map.init (); - back_map.init (); - } - - /* XXX(remove) */ - void fini () - { - forw_map.fini (); - back_map.fini (); - } - void reset () { forw_map.reset (); diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index 930edde12..60a190615 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -2930,8 +2930,6 @@ struct VariationStore hb_vector_t inner_maps; inner_maps.resize ((unsigned) dataSets.len); - for (unsigned i = 0; i < inner_maps.length; i++) - inner_maps[i].init (); for (unsigned idx : c->plan->layout_variation_indices->iter ()) { @@ -2939,18 +2937,11 @@ struct VariationStore uint16_t minor = idx & 0xFFFF; if (major >= inner_maps.length) - { - for (unsigned i = 0; i < inner_maps.length; i++) - inner_maps[i].fini (); return_trace (false); - } inner_maps[major].add (minor); } varstore_prime->serialize (c->serializer, this, inner_maps.as_array ()); - for (unsigned i = 0; i < inner_maps.length; i++) - inner_maps[i].fini (); - return_trace ( !c->serializer->in_error() && varstore_prime->dataSets); diff --git a/src/hb-ot-var-hvar-table.hh b/src/hb-ot-var-hvar-table.hh index 074b6a378..e9d90352f 100644 --- a/src/hb-ot-var-hvar-table.hh +++ b/src/hb-ot-var-hvar-table.hh @@ -177,9 +177,6 @@ struct hvarvvar_subset_plan_t inner_maps.resize (var_store->get_sub_table_count ()); - for (unsigned int i = 0; i < inner_maps.length; i++) - inner_maps[i].init (); - if (unlikely (!index_map_plans.length || !inner_sets.length || !inner_maps.length)) return; bool retain_adv_map = false; @@ -229,8 +226,8 @@ struct hvarvvar_subset_plan_t for (unsigned int i = 0; i < inner_sets.length; i++) hb_set_destroy (inner_sets[i]); hb_set_destroy (adv_set); - inner_maps.fini_deep (); - index_map_plans.fini_deep (); + inner_maps.fini (); + index_map_plans.fini (); } hb_inc_bimap_t outer_map; diff --git a/src/hb-subset-cff-common.hh b/src/hb-subset-cff-common.hh index 7fd96ca86..f02d57599 100644 --- a/src/hb-subset-cff-common.hh +++ b/src/hb-subset-cff-common.hh @@ -526,19 +526,9 @@ struct subr_remap_t : hb_inc_bimap_t struct subr_remaps_t { - subr_remaps_t () - { - global_remap.init (); - local_remaps.init (); - } - - ~subr_remaps_t () { fini (); } - void init (unsigned int fdCount) { - if (unlikely (!local_remaps.resize (fdCount))) return; - for (unsigned int i = 0; i < fdCount; i++) - local_remaps[i].init (); + local_remaps.resize (fdCount); } bool in_error() @@ -553,12 +543,6 @@ struct subr_remaps_t local_remaps[i].create (closures.local_closures[i]); } - void fini () - { - global_remap.fini (); - local_remaps.fini_deep (); - } - subr_remap_t global_remap; hb_vector_t local_remaps; }; @@ -577,7 +561,6 @@ struct subr_subsetter_t ~subr_subsetter_t () { closures.fini (); - remaps.fini (); parsed_charstrings.fini_deep (); parsed_global_subrs.fini_deep (); parsed_local_subrs.fini_deep (); diff --git a/src/hb-subset-cff1.cc b/src/hb-subset-cff1.cc index 40ab224cb..3bdef6080 100644 --- a/src/hb-subset-cff1.cc +++ b/src/hb-subset-cff1.cc @@ -371,14 +371,10 @@ struct cff_subset_plan { { topdict_mod.init (); subset_fdselect_ranges.init (); - fdmap.init (); subset_charstrings.init (); subset_globalsubrs.init (); - subset_localsubrs.init (); - fontdicts_mod.init (); subset_enc_code_ranges.init (); subset_charset_ranges.init (); - sidmap.init (); for (unsigned int i = 0; i < name_dict_values_t::ValCount; i++) topDictModSIDs[i] = CFF_UNDEF_SID; } @@ -387,14 +383,10 @@ struct cff_subset_plan { { topdict_mod.fini (); subset_fdselect_ranges.fini (); - fdmap.fini (); subset_charstrings.fini_deep (); subset_globalsubrs.fini_deep (); - subset_localsubrs.fini_deep (); - fontdicts_mod.fini (); subset_enc_code_ranges.fini (); subset_charset_ranges.fini (); - sidmap.fini (); } void plan_subset_encoding (const OT::cff1::accelerator_subset_t &acc, hb_subset_plan_t *plan) diff --git a/src/hb-subset-cff2.cc b/src/hb-subset-cff2.cc index 896ae6401..abad2d99c 100644 --- a/src/hb-subset-cff2.cc +++ b/src/hb-subset-cff2.cc @@ -242,7 +242,6 @@ struct cff2_subset_plan { desubroutinize (false) { subset_fdselect_ranges.init (); - fdmap.init (); subset_charstrings.init (); subset_globalsubrs.init (); subset_localsubrs.init (); @@ -251,7 +250,6 @@ struct cff2_subset_plan { ~cff2_subset_plan () { subset_fdselect_ranges.fini (); - fdmap.fini (); subset_charstrings.fini_deep (); subset_globalsubrs.fini_deep (); subset_localsubrs.fini_deep ();