[cff1] Tighten up range_list_t a bit

This commit is contained in:
Behdad Esfahbod 2022-05-16 15:53:28 -06:00
parent 3fbac0942d
commit e1e359b4da
1 changed files with 6 additions and 6 deletions

View File

@ -270,13 +270,13 @@ struct range_list_t : hb_vector_t<code_pair_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;
}