From 4ee00f943f4fde9418c21804a263f902557e76dc Mon Sep 17 00:00:00 2001 From: Andy John Date: Mon, 21 Mar 2022 13:16:28 -0700 Subject: [PATCH] Use bit shifting instead of multiplying and dividing. --- src/hb-bit-set.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hb-bit-set.hh b/src/hb-bit-set.hh index a471ee48b..3503796c2 100644 --- a/src/hb-bit-set.hh +++ b/src/hb-bit-set.hh @@ -809,8 +809,8 @@ struct hb_bit_set_t } page_t &page_at (unsigned int i) { return pages[page_map[i].index]; } const page_t &page_at (unsigned int i) const { return pages[page_map[i].index]; } - unsigned int get_major (hb_codepoint_t g) const { return g / page_t::PAGE_BITS; } - hb_codepoint_t major_start (unsigned int major) const { return major * page_t::PAGE_BITS; } + unsigned int get_major (hb_codepoint_t g) const { return g >> page_t::PAGE_BITS_LG_2; } + hb_codepoint_t major_start (unsigned int major) const { return major << page_t::PAGE_BITS_LG_2; } };