[gsubgpos] Use a couple variables

pull/4337/head
Behdad Esfahbod 1 year ago
parent 0ccd61a3b2
commit e8de5cb08f
  1. 30
      src/hb-ot-layout-gsubgpos.hh

@ -2214,6 +2214,8 @@ struct RuleSet
unsafe_to2 = skippy_iter.idx + 1;
}
auto match_input = lookup_context.funcs.match;
auto *input_data = lookup_context.match_data;
for (unsigned int i = 0; i < num_rules; i++)
{
const auto &r = this+rule.arrayZ[i];
@ -2221,13 +2223,13 @@ struct RuleSet
const auto &input = r.inputZ;
if (r.inputCount <= 1 ||
(!lookup_context.funcs.match ||
lookup_context.funcs.match (*first, input.arrayZ[0], lookup_context.match_data)))
(!match_input ||
match_input (*first, input.arrayZ[0], input_data)))
{
if (!second ||
(r.inputCount <= 2 ||
(!lookup_context.funcs.match ||
lookup_context.funcs.match (*second, input.arrayZ[1], lookup_context.match_data)))
(!match_input ||
match_input (*second, input.arrayZ[1], input_data)))
)
{
if (r.apply (c, lookup_context))
@ -3384,6 +3386,10 @@ struct ChainRuleSet
unsafe_to2 = skippy_iter.idx + 1;
}
auto match_input = lookup_context.funcs.match[1];
auto match_lookahead = lookup_context.funcs.match[2];
auto *input_data = lookup_context.match_data[1];
auto *lookahead_data = lookup_context.match_data[2];
for (unsigned int i = 0; i < num_rules; i++)
{
const auto &r = this+rule.arrayZ[i];
@ -3393,19 +3399,19 @@ struct ChainRuleSet
unsigned lenP1 = hb_max ((unsigned) input.lenP1, 1u);
if (lenP1 > 1 ?
(!lookup_context.funcs.match[1] ||
lookup_context.funcs.match[1] (*first, input.arrayZ[0], lookup_context.match_data[1]))
(!match_input ||
match_input (*first, input.arrayZ[0], input_data))
:
(!lookahead.len || !lookup_context.funcs.match[2] ||
lookup_context.funcs.match[2] (*first, lookahead.arrayZ[0], lookup_context.match_data[2])))
(!lookahead.len || !match_lookahead ||
match_lookahead (*first, lookahead.arrayZ[0], lookahead_data)))
{
if (!second ||
(lenP1 > 2 ?
(!lookup_context.funcs.match[1] ||
lookup_context.funcs.match[1] (*second, input.arrayZ[1], lookup_context.match_data[1]))
(!match_input ||
match_input (*second, input.arrayZ[1], input_data))
:
(lookahead.len <= 2 - lenP1 || !lookup_context.funcs.match[2] ||
lookup_context.funcs.match[2] (*second, lookahead.arrayZ[2 - lenP1], lookup_context.match_data[2]))))
(lookahead.len <= 2 - lenP1 || !match_lookahead ||
match_lookahead (*second, lookahead.arrayZ[2 - lenP1], lookahead_data))))
{
if (r.apply (c, lookup_context))
{

Loading…
Cancel
Save