[aat] Optimize feature application

This commit is contained in:
Behdad Esfahbod 2023-01-10 12:16:04 -07:00
parent 4ee6094114
commit 0e11d317ee
2 changed files with 4 additions and 2 deletions

View File

@ -786,7 +786,8 @@ struct StateTableDriver
buffer->unsafe_to_concat ();
int state = StateTableT::STATE_START_OF_TEXT;
auto *last_range = ac->range_flags && (*ac->range_flags) ? &(*ac->range_flags)[0] : nullptr;
// If there's only one range, we already checked the flag.
auto *last_range = ac->range_flags && (ac->range_flags->length > 1) ? &(*ac->range_flags)[0] : nullptr;
for (buffer->idx = 0; buffer->successful;)
{
if (last_range)

View File

@ -618,7 +618,8 @@ struct NoncontextualSubtable
hb_glyph_info_t *info = c->buffer->info;
unsigned int count = c->buffer->len;
auto *last_range = c->range_flags && (*c->range_flags) ? &(*c->range_flags)[0] : nullptr;
// If there's only one range, we already checked the flag.
auto *last_range = c->range_flags && (c->range_flags->length > 1) ? &(*c->range_flags)[0] : nullptr;
for (unsigned int i = 0; i < count; i++)
{
if (last_range)