[subset] Presize unicode to gid list to unicodes + glyphs size.

This commit is contained in:
Garret Rieger 2022-05-04 20:21:43 +00:00
parent 7c7c01d28c
commit 42c54eba83
1 changed files with 2 additions and 1 deletions

View File

@ -326,7 +326,8 @@ _populate_unicodes_to_retain (const hb_set_t *unicodes,
// them with cmap entries.
hb_map_t unicode_glyphid_map;
cmap.collect_mapping (hb_set_get_empty (), &unicode_glyphid_map);
plan->unicode_to_new_gid_list.alloc (unicode_glyphid_map.get_population ());
plan->unicode_to_new_gid_list.alloc (unicodes->get_population ()
+ glyphs->get_population ());
for (hb_pair_t<hb_codepoint_t, hb_codepoint_t> cp_gid :
+ unicode_glyphid_map.iter ())