[glyf] Micro-optimize encode_flag()

This commit is contained in:
Behdad Esfahbod 2022-11-22 14:49:01 -07:00
parent d47cfe7936
commit b6694597f9
1 changed files with 4 additions and 3 deletions

View File

@ -243,13 +243,14 @@ struct SimpleGlyph
repeat++;
if (repeat == 1)
{
flags.push(flag);
/* We know there's room. */
flags.arrayZ[flags.length++] = flag;
}
else
{
unsigned len = flags.length;
flags[len-2] = flag | FLAG_REPEAT;
flags[len-1] = repeat;
flags.arrayZ[len-2] = flag | FLAG_REPEAT;
flags.arrayZ[len-1] = repeat;
}
}
else