Revert "[ot-lang] Use atomic int for cache"

This reverts commit d61b207491.
This commit is contained in:
Behdad Esfahbod 2022-05-28 04:25:51 -06:00
parent 63bc6be0cf
commit c56ce8681c
1 changed files with 3 additions and 3 deletions

View File

@ -297,13 +297,13 @@ hb_ot_tags_from_language (const char *lang_str,
hb_tag_t lang_tag = hb_tag_from_string (lang_str, first_len);
static hb_atomic_int_t last_tag_idx; /* Poor man's cache. */
unsigned tag_idx = last_tag_idx.get_relaxed ();
static unsigned last_tag_idx; /* Poor man's cache. */
unsigned tag_idx = last_tag_idx;
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.set_relaxed (tag_idx);
last_tag_idx = tag_idx;
unsigned int i;
while (tag_idx != 0 &&
ot_languages[tag_idx].language == ot_languages[tag_idx - 1].language)