Revert "Avoid use values () in hb-hashmap if value_t has an overriden operator &"

This reverts commit b92e4cc009.
This commit is contained in:
Behdad Esfahbod 2022-11-14 15:59:46 -07:00
parent ff0d0d020e
commit ebc382a847
3 changed files with 8 additions and 12 deletions

View File

@ -249,13 +249,12 @@ hb_subset_input_destroy (hb_subset_input_t *input)
hb_hashmap_destroy (input->axes_location);
#ifdef HB_EXPERIMENTAL_API
if (input->name_table_overrides)
{
for (auto _ : *input->name_table_overrides)
_.second.fini ();
for (auto _ : input->name_table_overrides->values ())
_.fini ();
}
#endif
hb_hashmap_destroy (input->name_table_overrides);
hb_free (input);

View File

@ -849,7 +849,6 @@ hb_subset_plan_create_or_fail (hb_face_t *face,
plan->check_success (plan->hmtx_map = hb_hashmap_create<unsigned, hb_pair_t<unsigned, int>> ());
plan->check_success (plan->name_table_overrides = hb_hashmap_create<unsigned, hb_bytes_t> ());
#ifdef HB_EXPERIMENTAL_API
if (plan->name_table_overrides && input->name_table_overrides)
{
for (auto _ : *input->name_table_overrides)
@ -861,8 +860,8 @@ hb_subset_plan_create_or_fail (hb_face_t *face,
char *name_str = (char *) hb_malloc (len);
if (unlikely (!plan->check_success (name_str)))
{
for (auto pair : *plan->name_table_overrides)
pair.second.fini ();
for (auto bytes : plan->name_table_overrides->values ())
bytes.fini ();
break;
}
@ -870,7 +869,7 @@ hb_subset_plan_create_or_fail (hb_face_t *face,
plan->name_table_overrides->set (name_id, hb_bytes_t (name_str, len));
}
}
#endif
void* accel = hb_face_get_user_data(face, hb_subset_accelerator_t::user_data_key());

View File

@ -87,13 +87,11 @@ struct hb_subset_plan_t
hb_hashmap_destroy (vmtx_map);
hb_hashmap_destroy (layout_variation_idx_delta_map);
#ifdef HB_EXPERIMENTAL_API
if (name_table_overrides)
{
for (auto _ : *name_table_overrides)
_.second.fini ();
for (auto _ : name_table_overrides->values ())
_.fini ();
}
#endif
hb_hashmap_destroy (name_table_overrides);
if (user_axes_location)