[gsubgpos] Fix optimization

Fixes https://github.com/harfbuzz/harfbuzz/issues/4336
This commit is contained in:
Behdad Esfahbod committed 2023-07-20 22:12:53 -06:00
1 parent 36c7ec443b
commit e8948a4e86
1 file changed
+6 -1
+6 -1
View File
@@ -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
)