[ot-layout] Cosmetic

The implementation of HBUINT16 operator == is slower than just
comparing to ints.
This commit is contained in:
Behdad Esfahbod 2022-05-18 13:53:52 -06:00
parent 777debd748
commit 63c6695108
1 changed files with 2 additions and 4 deletions

View File

@ -2037,10 +2037,9 @@ struct ClassDefFormat1
}
/* TODO Speed up, using set overlap first? */
/* TODO(iter) Rewrite as dagger. */
HBUINT16 k {klass};
const HBUINT16 *arr = classValue.arrayZ;
for (unsigned int i = 0; i < count; i++)
if (arr[i] == k && glyphs->has (startGlyph + i))
if (arr[i] == klass && glyphs->has (startGlyph + i))
return true;
return false;
}
@ -2272,10 +2271,9 @@ struct ClassDefFormat2
}
/* TODO Speed up, using set overlap first? */
/* TODO(iter) Rewrite as dagger. */
HBUINT16 k {klass};
const RangeRecord *arr = rangeRecord.arrayZ;
for (unsigned int i = 0; i < count; i++)
if (arr[i].value == k && arr[i].intersects (glyphs))
if (arr[i].value == klass && arr[i].intersects (glyphs))
return true;
return false;
}