Match input before backtrack

Makes more sense, optimization-wise.
This commit is contained in:
Behdad Esfahbod 2012-06-09 02:26:57 -04:00
parent 67bb9e8cea
commit f19e0b0099
1 changed files with 4 additions and 4 deletions

View File

@ -882,13 +882,13 @@ static inline bool chain_context_apply_lookup (hb_apply_context_t *c,
ChainContextApplyLookupContext &lookup_context) ChainContextApplyLookupContext &lookup_context)
{ {
unsigned int lookahead_offset; unsigned int lookahead_offset;
return match_backtrack (c, return match_input (c,
backtrackCount, backtrack,
lookup_context.funcs.match, lookup_context.match_data[0])
&& match_input (c,
inputCount, input, inputCount, input,
lookup_context.funcs.match, lookup_context.match_data[1], lookup_context.funcs.match, lookup_context.match_data[1],
&lookahead_offset) &lookahead_offset)
&& match_backtrack (c,
backtrackCount, backtrack,
lookup_context.funcs.match, lookup_context.match_data[0])
&& match_lookahead (c, && match_lookahead (c,
lookaheadCount, lookahead, lookaheadCount, lookahead,
lookup_context.funcs.match, lookup_context.match_data[2], lookup_context.funcs.match, lookup_context.match_data[2],