From e1e359b4daac86cea0a4f02f7f175e93ea9440d7 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 16 May 2022 15:53:28 -0600 Subject: [PATCH] [cff1] Tighten up range_list_t a bit --- src/hb-subset-cff1.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hb-subset-cff1.cc b/src/hb-subset-cff1.cc index 6b187335a..8a3034db0 100644 --- a/src/hb-subset-cff1.cc +++ b/src/hb-subset-cff1.cc @@ -270,13 +270,13 @@ 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; - for (unsigned int i = (*this).length; i > 0; i--) + bool two_byte = false; + unsigned count = this->length; + for (unsigned int i = count; i; i--) { - code_pair_t &pair = (*this)[i - 1]; - unsigned int nLeft = last_glyph - pair.glyph - 1; - if (nLeft >= 0x100) - two_byte = true; + code_pair_t &pair = arrayZ[i - 1]; + unsigned int nLeft = last_glyph - pair.glyph - 1; + two_byte |= nLeft >= 0x100; last_glyph = pair.glyph; pair.glyph = nLeft; }