[subset-cff] Cosmetic

This commit is contained in:
Behdad Esfahbod 2022-05-18 11:58:58 -06:00
parent 0b201623f5
commit b5aa8a27ea
1 changed files with 3 additions and 2 deletions

View File

@ -851,9 +851,10 @@ struct subr_subsetter_t
bool encode_str (const parsed_cs_str_t &str, const unsigned int fd, str_buff_t &buff) const
{
unsigned count = str.get_count ();
str_encoder_t encoder (buff);
encoder.reset ();
buff.alloc (str.get_count () * 3);
buff.alloc (count * 3);
/* if a prefix (CFF1 width or CFF2 vsindex) has been removed along with hints,
* re-insert it at the beginning of charstreing */
if (str.has_prefix () && str.is_hint_dropped ())
@ -862,7 +863,7 @@ struct subr_subsetter_t
if (str.prefix_op () != OpCode_Invalid)
encoder.encode_op (str.prefix_op ());
}
for (unsigned int i = 0; i < str.get_count(); i++)
for (unsigned int i = 0; i < count; i++)
{
const parsed_cs_op_t &opstr = str.values[i];
if (!opstr.for_drop () && !opstr.for_skip ())