From 8265277c2ee60c6d9f4e6b87f86bc2b3b296338a Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 11 Jan 2023 12:32:04 -0700 Subject: [PATCH] [subset-plan] Simplify axes_location allocation --- src/hb-subset-plan.cc | 5 ++--- src/hb-subset-plan.hh | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/hb-subset-plan.cc b/src/hb-subset-plan.cc index 1f124dcb9..e8d42826a 100644 --- a/src/hb-subset-plan.cc +++ b/src/hb-subset-plan.cc @@ -166,7 +166,7 @@ static void _collect_layout_indices (hb_subset_plan_t *plan, OT::hb_collect_feature_substitutes_with_var_context_t c = { &plan->axes_old_index_tag_map, - plan->axes_location, + &plan->axes_location, feature_record_cond_idx_map, feature_substitutes_map, feature_indices, @@ -797,7 +797,7 @@ _normalize_axes_location (hb_face_t *face, hb_subset_plan_t *plan) { normalized_v = seg_maps->map (normalized_v); } - plan->axes_location->set (axis_tag, normalized_v); + plan->axes_location.set (axis_tag, normalized_v); if (normalized_v != 0) plan->pinned_at_default = false; @@ -857,7 +857,6 @@ hb_subset_plan_create_or_fail (hb_face_t *face, plan->gdef_varstore_inner_maps.init (); - 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) *plan->user_axes_location = *input->axes_location; diff --git a/src/hb-subset-plan.hh b/src/hb-subset-plan.hh index 508b5aca3..b60d28bde 100644 --- a/src/hb-subset-plan.hh +++ b/src/hb-subset-plan.hh @@ -56,7 +56,6 @@ struct hb_subset_plan_t hb_map_destroy (reverse_glyph_map); hb_map_destroy (axes_index_map); - hb_hashmap_destroy (axes_location); hb_hashmap_destroy (user_axes_location); #ifdef HB_EXPERIMENTAL_API @@ -155,7 +154,7 @@ struct hb_subset_plan_t hb_hashmap_t> sanitized_table_cache; //normalized axes location map - hb_hashmap_t *axes_location; + hb_hashmap_t axes_location; hb_vector_t normalized_coords; //user specified axes location map hb_hashmap_t *user_axes_location;