[cff-subset] Pre-alloc vector for operator decoding

This commit is contained in:
Behdad Esfahbod 2022-05-11 12:10:03 -06:00
parent 7edd54f3dd
commit f08537963b
2 changed files with 6 additions and 0 deletions

View File

@ -520,6 +520,11 @@ struct parsed_values_t
}
void fini () { values.fini (); }
void alloc (unsigned n)
{
values.alloc (n);
}
void add_op (op_code_t op, const byte_str_ref_t& str_ref = byte_str_ref_t ())
{
VAL *val = values.push ();

View File

@ -569,6 +569,7 @@ struct subr_subsetter_t
ENV env (str, acc, fd);
cs_interpreter_t<ENV, OPSET, subr_subset_param_t> interp (env);
parsed_charstrings[i].alloc (str.length);
subr_subset_param_t param (&parsed_charstrings[i],
&parsed_global_subrs,
&parsed_local_subrs[fd],