Revert "[ot-lang] Use atomic int for cache"
This reverts commit d61b207491
.
This commit is contained in:
parent
63bc6be0cf
commit
c56ce8681c
|
@ -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);
|
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. */
|
static unsigned last_tag_idx; /* Poor man's cache. */
|
||||||
unsigned tag_idx = last_tag_idx.get_relaxed ();
|
unsigned tag_idx = last_tag_idx;
|
||||||
|
|
||||||
if (likely (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))
|
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;
|
unsigned int i;
|
||||||
while (tag_idx != 0 &&
|
while (tag_idx != 0 &&
|
||||||
ot_languages[tag_idx].language == ot_languages[tag_idx - 1].language)
|
ot_languages[tag_idx].language == ot_languages[tag_idx - 1].language)
|
||||||
|
|
Loading…
Reference in New Issue