From 7b97262b03bf86fe19901820903fe508e563787a Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 4 Jun 2023 15:55:18 -0600 Subject: [PATCH] [subset/cff1] Micro-optimize --- src/hb-ot-cff1-table.hh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-cff1-table.hh b/src/hb-ot-cff1-table.hh index 0cbf014be..e1d8f2926 100644 --- a/src/hb-ot-cff1-table.hh +++ b/src/hb-ot-cff1-table.hh @@ -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++) {