[ot-tag] Add a likely() to the cache hit case

This commit is contained in:
Behdad Esfahbod 2022-05-17 16:46:10 -06:00
parent 0ff5d36cd4
commit a07d818597
1 changed files with 1 additions and 1 deletions

View File

@ -293,7 +293,7 @@ hb_ot_tags_from_language (const char *lang_str,
static unsigned last_tag_idx; /* Poor man's cache. */
unsigned tag_idx = last_tag_idx;
if ((tag_idx < ot_languages_len && ot_languages[tag_idx].language == lang_tag) ||
if (likely (tag_idx < ot_languages_len && ot_languages[tag_idx].language == lang_tag) ||
hb_sorted_array (ot_languages, ot_languages_len).bfind (lang_tag, &tag_idx))
{
last_tag_idx = tag_idx;