[minor] Add unlikely()

This commit is contained in:
Behdad Esfahbod 2021-02-10 00:03:30 -07:00
parent 6e1afac64b
commit 1da75afbe8
1 changed files with 3 additions and 2 deletions

View File

@ -1187,7 +1187,7 @@ static inline bool apply_lookup (hb_ot_apply_context_t *c,
/* Don't recurse to ourself at same position. /* Don't recurse to ourself at same position.
* Note that this test is too naive, it doesn't catch longer loops. */ * Note that this test is too naive, it doesn't catch longer loops. */
if (idx == 0 && lookupRecord[i].lookupListIndex == c->lookup_index) if (unlikely (idx == 0 && lookupRecord[i].lookupListIndex == c->lookup_index))
continue; continue;
if (unlikely (!buffer->move_to (match_positions[idx]))) if (unlikely (!buffer->move_to (match_positions[idx])))
@ -1225,7 +1225,8 @@ static inline bool apply_lookup (hb_ot_apply_context_t *c,
* mean that n match positions where removed, as there might * mean that n match positions where removed, as there might
* have been marks and default-ignorables in the sequence. We * have been marks and default-ignorables in the sequence. We
* should instead drop match positions between current-position * should instead drop match positions between current-position
* and current-position + n instead. * and current-position + n instead. Though, am not sure which
* one is better. Both cases have valid uses. Sigh.
* *
* It should be possible to construct tests for both of these cases. * It should be possible to construct tests for both of these cases.
*/ */