mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-30 10:04:24 +01:00
[contextual] Implement rule-skipping for ChainContext as well
Speeds up NotoNastaliq benchmark another 5%.
This commit is contained in:
1 parent
8bd832dff1
commit
f629ecdc5c
1 file changed
+12
@@ -3544,6 +3544,18 @@ struct ChainRuleSet
|
||||
{
|
||||
if (unsafe_to == (unsigned) -1)
|
||||
unsafe_to = unsafe_to1;
|
||||
|
||||
if (lenP1 > 1)
|
||||
{
|
||||
// Skip ahead to next possible first glyph match.
|
||||
for (; i + 1 < num_rules; i++)
|
||||
{
|
||||
const auto &r2 = this+rule.arrayZ[i + 1];
|
||||
const auto &input2 = StructAfter<decltype (r2.inputX)> (r2.backtrack);
|
||||
if (input2.lenP1 <= 1 || input2.arrayZ[0] != input.arrayZ[0])
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (likely (unsafe_to != (unsigned) -1))
|
||||
|
||||
Reference in new issue
Block a user