mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-21 23:11:04 +01:00
[gsubgpos] Add fast-path for end-of-string in (Chain)RuleSet::apply()
This commit is contained in:
1 parent
e7ce633946
commit
4ea3737d04
1 file changed
+24
-2
@@ -2204,7 +2204,18 @@ struct RuleSet
|
||||
}
|
||||
}
|
||||
else
|
||||
goto slow;
|
||||
{
|
||||
/* Failed to match a next glyph. Only try applying rules that have
|
||||
* no further input. */
|
||||
return_trace (
|
||||
+ hb_iter (rule)
|
||||
| hb_map (hb_add (this))
|
||||
| hb_filter ([&] (const Rule &_) { return _.inputCount <= 1; })
|
||||
| hb_map ([&] (const Rule &_) { return _.apply (c, lookup_context); })
|
||||
| hb_any
|
||||
)
|
||||
;
|
||||
}
|
||||
|
||||
bool unsafe_to_concat = false;
|
||||
|
||||
@@ -3346,7 +3357,18 @@ struct ChainRuleSet
|
||||
}
|
||||
}
|
||||
else
|
||||
goto slow;
|
||||
{
|
||||
/* Failed to match a next glyph. Only try applying rules that have
|
||||
* no further input and lookahead. */
|
||||
return_trace (
|
||||
+ hb_iter (rule)
|
||||
| hb_map (hb_add (this))
|
||||
| hb_filter ([&] (const ChainRule &_) { return _.inputX.lenP1 <= 1 && _.lookaheadX.len == 0; })
|
||||
| hb_map ([&] (const ChainRule &_) { return _.apply (c, lookup_context); })
|
||||
| hb_any
|
||||
)
|
||||
;
|
||||
}
|
||||
|
||||
bool unsafe_to_concat = false;
|
||||
|
||||
|
||||
Reference in new issue
Block a user