summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/harfbuzz-ng/src/hb-ot-name-language-static.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/harfbuzz-ng/src/hb-ot-name-language-static.hh')
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-name-language-static.hh15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-name-language-static.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-name-language-static.hh
index 580e7637b9..c496dc2981 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-name-language-static.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-name-language-static.hh
@@ -37,12 +37,8 @@
struct hb_ot_language_map_t
{
- static int cmp (const void *key, const void *item)
- {
- unsigned int a = * (unsigned int *) key;
- unsigned int b = ((const hb_ot_language_map_t *) item)->code;
- return a < b ? -1 : a > b ? +1 : 0;
- }
+ int cmp (unsigned int key) const
+ { return key < code ? -1 : key > code ? +1 : 0; }
uint16_t code;
char lang[6];
@@ -433,12 +429,7 @@ _hb_ot_name_language_for (unsigned int code,
#ifdef HB_NO_OT_NAME_LANGUAGE
return HB_LANGUAGE_INVALID;
#endif
- const hb_ot_language_map_t *entry = (const hb_ot_language_map_t *)
- hb_bsearch (&code,
- array,
- len,
- sizeof (array[0]),
- hb_ot_language_map_t::cmp);
+ auto *entry = hb_bsearch (code, array, len);
if (entry)
return hb_language_from_string (entry->lang, -1);