From 2dcbf3bd07ea10bf81548f4407afead2cc1ea2b0 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 12 Jan 2023 18:29:16 -0700 Subject: [PATCH] [os2] Inline a trivial function --- src/hb-ot-os2-table.hh | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/hb-ot-os2-table.hh b/src/hb-ot-os2-table.hh index 7b3fdee28..22cdb652e 100644 --- a/src/hb-ot-os2-table.hh +++ b/src/hb-ot-os2-table.hh @@ -269,12 +269,8 @@ struct OS2 if (c->plan->flags & HB_SUBSET_FLAGS_NO_PRUNE_UNICODE_RANGES) return_trace (true); - /* when --gids option is not used, no need to do collect_mapping that is - * iterating all codepoints in each subtable, which is not efficient */ - uint16_t min_cp, max_cp; - find_min_and_max_codepoint (&c->plan->unicodes, &min_cp, &max_cp); - os2_prime->usFirstCharIndex = min_cp; - os2_prime->usLastCharIndex = max_cp; + os2_prime->usFirstCharIndex = hb_min (0xFFFFu, c->plan->unicodes.get_min ()); + os2_prime->usLastCharIndex = hb_min (0xFFFFu, c->plan->unicodes.get_max ()); _update_unicode_ranges (&c->plan->unicodes, os2_prime->ulUnicodeRange); @@ -311,14 +307,6 @@ struct OS2 ulUnicodeRange[i] = ulUnicodeRange[i] & newBits[i]; // set bits only if set in the original } - static void find_min_and_max_codepoint (const hb_set_t *codepoints, - uint16_t *min_cp, /* OUT */ - uint16_t *max_cp /* OUT */) - { - *min_cp = hb_min (0xFFFFu, codepoints->get_min ()); - *max_cp = hb_min (0xFFFFu, codepoints->get_max ()); - } - /* https://github.com/Microsoft/Font-Validator/blob/520aaae/OTFontFileVal/val_OS2.cs#L644-L681 * https://docs.microsoft.com/en-us/typography/legacy/legacy_arabic_fonts */ enum font_page_t