[gsubgpos] Fix optimization

Fixes https://github.com/harfbuzz/harfbuzz/issues/4336
pull/4337/head
Behdad Esfahbod 1 year ago
parent 36c7ec443b
commit e8948a4e86
  1. 7
      src/hb-ot-layout-gsubgpos.hh

@ -3373,7 +3373,12 @@ struct ChainRuleSet
return_trace (
+ hb_iter (rule)
| hb_map (hb_add (this))
| hb_filter ([&] (const ChainRule &_) { return _.inputX.lenP1 <= 1 && _.lookaheadX.len == 0; })
| hb_filter ([&] (const ChainRule &_)
{
const auto &input = StructAfter<decltype (_.inputX)> (_.backtrack);
const auto &lookahead = StructAfter<decltype (_.lookaheadX)> (input);
return input.lenP1 <= 1 && lookahead.len == 0;
})
| hb_map ([&] (const ChainRule &_) { return _.apply (c, lookup_context); })
| hb_any
)

Loading…
Cancel
Save