From aa7dd70a862d6fa516e0aa8194e4cd4983cda934 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 1 Jun 2023 14:24:33 -0600 Subject: [PATCH] [hmtx] Reduce map usage slightly --- src/hb-ot-hmtx-table.hh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-hmtx-table.hh b/src/hb-ot-hmtx-table.hh index 90622bc16..dc2d59b39 100644 --- a/src/hb-ot-hmtx-table.hh +++ b/src/hb-ot-hmtx-table.hh @@ -214,7 +214,8 @@ struct hmtxvmtx + hb_range (c->plan->num_output_glyphs ()) | hb_map ([c, &_mtx, mtx_map] (unsigned _) { - if (!mtx_map->has (_)) + hb_pair_t *v = nullptr; + if (!mtx_map->has (_, &v)) { hb_codepoint_t old_gid; if (!c->plan->old_gid_for_new_gid (_, &old_gid)) @@ -224,7 +225,7 @@ struct hmtxvmtx (void) _glyf_get_leading_bearing_without_var_unscaled (c->plan->source, old_gid, !T::is_horizontal, &lsb); return hb_pair (_mtx.get_advance_without_var_unscaled (old_gid), +lsb); } - return mtx_map->get (_); + return *v; }) ;