[subset/cff1] Micro-optimize

This commit is contained in:
Behdad Esfahbod 2023-06-04 15:55:18 -06:00
parent 59387dbe43
commit 7b97262b03

View file

@ -396,13 +396,18 @@ struct Charset1_2 {
{
if (unlikely (glyph >= num_glyphs)) return 0;
if (unlikely (glyph == 0)) return 0;
hb_codepoint_t start_glyph = 1;
unsigned i = 0;
unsigned i;
hb_codepoint_t start_glyph;
if (cache && likely (cache->glyph <= glyph))
{
i = cache->code;
start_glyph = cache->glyph;
}
else
{
i = 0;
start_glyph = 1;
}
glyph -= start_glyph;
for (;; i++)
{