[subset-cff] Micro-optimize encode_byte

This commit is contained in:
Behdad Esfahbod 2022-11-23 13:00:23 -07:00
parent a23f820427
commit 0bf7d9eb4d
1 changed files with 6 additions and 1 deletions

View File

@ -43,7 +43,12 @@ struct str_encoder_t
void reset () { buff.reset (); }
void encode_byte (unsigned char b)
{ buff.push (b); }
{
if (likely ((signed) buff.length < buff.allocated))
buff.arrayZ[buff.length++] = b;
else
buff.push (b);
}
void encode_int (int v)
{