From 89905368ca75496fac663710ea03f1bb90cd33cb Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 11 Jan 2023 11:13:49 -0700 Subject: [PATCH] [subset-plan] Simplify sanitized_table_cache allocation --- src/hb-subset-plan.cc | 1 - src/hb-subset-plan.hh | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/hb-subset-plan.cc b/src/hb-subset-plan.cc index 47afb5105..db5702d20 100644 --- a/src/hb-subset-plan.cc +++ b/src/hb-subset-plan.cc @@ -862,7 +862,6 @@ hb_subset_plan_create_or_fail (hb_face_t *face, plan->check_success (plan->layout_variation_idx_delta_map = hb_hashmap_create> ()); plan->gdef_varstore_inner_maps.init (); - plan->check_success (plan->sanitized_table_cache = hb_hashmap_create> ()); plan->check_success (plan->axes_location = hb_hashmap_create ()); plan->check_success (plan->user_axes_location = hb_hashmap_create ()); if (plan->user_axes_location && input->axes_location) diff --git a/src/hb-subset-plan.hh b/src/hb-subset-plan.hh index 01445022d..76b1a25d0 100644 --- a/src/hb-subset-plan.hh +++ b/src/hb-subset-plan.hh @@ -64,7 +64,6 @@ struct hb_subset_plan_t hb_map_destroy (axes_old_index_tag_map); hb_hashmap_destroy (axes_location); - hb_hashmap_destroy (sanitized_table_cache); hb_hashmap_destroy (hmtx_map); hb_hashmap_destroy (vmtx_map); hb_hashmap_destroy (layout_variation_idx_delta_map); @@ -169,7 +168,7 @@ struct hb_subset_plan_t //gdef varstore retained varidx mapping hb_vector_t gdef_varstore_inner_maps; - hb_hashmap_t>* sanitized_table_cache; + hb_hashmap_t> sanitized_table_cache; //normalized axes location map hb_hashmap_t *axes_location; hb_vector_t normalized_coords; @@ -204,7 +203,7 @@ struct hb_subset_plan_t { hb_lock_t (accelerator ? &accelerator->sanitized_table_cache_lock : nullptr); - auto *cache = accelerator ? &accelerator->sanitized_table_cache : sanitized_table_cache; + auto *cache = accelerator ? &accelerator->sanitized_table_cache : &sanitized_table_cache; if (cache && !cache->in_error () && cache->has (+T::tableTag)) {