From b6694597f9b80d37fd8361723ae34861019a46ba Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 22 Nov 2022 14:49:01 -0700 Subject: [PATCH] [glyf] Micro-optimize encode_flag() --- src/OT/glyf/SimpleGlyph.hh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/OT/glyf/SimpleGlyph.hh b/src/OT/glyf/SimpleGlyph.hh index 9aa59c085..3312a5444 100644 --- a/src/OT/glyf/SimpleGlyph.hh +++ b/src/OT/glyf/SimpleGlyph.hh @@ -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