[cmap] Micro-optimize

This commit is contained in:
Behdad Esfahbod 2023-11-10 13:52:34 -07:00
parent 330c32f902
commit ae6ea6f4b7

View file

@ -743,10 +743,11 @@ struct CmapSubtableLongSegmented
unsigned num_glyphs) const
{
hb_codepoint_t last_end = 0;
for (unsigned i = 0; i < this->groups.len; i++)
unsigned count = this->groups.len;
for (unsigned i = 0; i < count; i++)
{
hb_codepoint_t start = this->groups[i].startCharCode;
hb_codepoint_t end = hb_min ((hb_codepoint_t) this->groups[i].endCharCode,
hb_codepoint_t start = this->groups.arrayZ[i].startCharCode;
hb_codepoint_t end = hb_min ((hb_codepoint_t) this->groups.arrayZ[i].endCharCode,
(hb_codepoint_t) HB_UNICODE_MAX);
if (unlikely (start > end || start < last_end)) {
// Range is not in order and is invalid, skip it.
@ -755,7 +756,7 @@ struct CmapSubtableLongSegmented
last_end = end;
hb_codepoint_t gid = this->groups[i].glyphID;
hb_codepoint_t gid = this->groups.arrayZ[i].glyphID;
if (!gid)
{
if (T::formatNumber == 13) continue;