[ClassDef] Write a loop as range for

This commit is contained in:
Behdad Esfahbod 2022-07-21 17:17:59 -06:00
parent 0cc2f3c218
commit 7cdde6a241
1 changed files with 2 additions and 5 deletions

View File

@ -1810,11 +1810,8 @@ struct ClassDefFormat2_4
return true;
/* Fall through. */
}
/* TODO Speed up, using set overlap first? */
/* TODO(iter) Rewrite as dagger. */
const auto *arr = rangeRecord.arrayZ;
for (unsigned int i = 0; i < count; i++)
if (arr[i].value == klass && arr[i].intersects (*glyphs))
for (const auto &range : rangeRecord)
if (range.value == klass && range.intersects (*glyphs))
return true;
return false;
}