[hmtx] Reduce map usage slightly

This commit is contained in:
Behdad Esfahbod committed 2023-06-01 14:24:33 -06:00
1 parent f41c5ec961
commit aa7dd70a86
1 file changed
+3 -2
+3 -2
View File
@@ -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<unsigned, int> *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;
})
;