[subset-cff] Pre-size map in subr_remap_t::create()
This commit is contained in:
parent
ce60462173
commit
e91863b717
|
@ -39,6 +39,12 @@ struct hb_bimap_t
|
||||||
back_map.reset ();
|
back_map.reset ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void resize (unsigned pop)
|
||||||
|
{
|
||||||
|
forw_map.resize (pop);
|
||||||
|
back_map.resize (pop);
|
||||||
|
}
|
||||||
|
|
||||||
bool in_error () const { return forw_map.in_error () || back_map.in_error (); }
|
bool in_error () const { return forw_map.in_error () || back_map.in_error (); }
|
||||||
|
|
||||||
void set (hb_codepoint_t lhs, hb_codepoint_t rhs)
|
void set (hb_codepoint_t lhs, hb_codepoint_t rhs)
|
||||||
|
|
|
@ -466,6 +466,7 @@ struct subr_remap_t : hb_inc_bimap_t
|
||||||
* no optimization based on usage counts. fonttools doesn't appear doing that either.
|
* no optimization based on usage counts. fonttools doesn't appear doing that either.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
resize (closure->get_population ());
|
||||||
hb_codepoint_t old_num = HB_SET_VALUE_INVALID;
|
hb_codepoint_t old_num = HB_SET_VALUE_INVALID;
|
||||||
while (hb_set_next (closure, &old_num))
|
while (hb_set_next (closure, &old_num))
|
||||||
add (old_num);
|
add (old_num);
|
||||||
|
|
Loading…
Reference in New Issue