From 40a1c08f4c7a74b71a7a832b86b94fe8f6aa06b3 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 26 Jun 2023 19:03:04 -0600 Subject: [PATCH] [subset/cff1] Micro-optimize --- src/hb-subset-cff1.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hb-subset-cff1.cc b/src/hb-subset-cff1.cc index 953d086d5..8b5e099f5 100644 --- a/src/hb-subset-cff1.cc +++ b/src/hb-subset-cff1.cc @@ -294,16 +294,17 @@ struct range_list_t : hb_vector_t /* replace the first glyph ID in the "glyph" field each range with a nLeft value */ bool complete (unsigned int last_glyph) { - bool two_byte = false; + hb_codepoint_t all_glyphs = 0; unsigned count = this->length; for (unsigned int i = count; i; i--) { code_pair_t &pair = arrayZ[i - 1]; unsigned int nLeft = last_glyph - pair.glyph - 1; - two_byte |= nLeft >= 0x100; + all_glyphs |= nLeft; last_glyph = pair.glyph; pair.glyph = nLeft; } + bool two_byte = all_glyphs >= 0x100; return two_byte; } };