Use bit shifting instead of multiplying and dividing.

This commit is contained in:
Andy John 2022-03-21 13:16:28 -07:00 committed by Behdad Esfahbod
parent 3125f5ae33
commit 4ee00f943f
1 changed files with 2 additions and 2 deletions

View File

@ -809,8 +809,8 @@ struct hb_bit_set_t
} }
page_t &page_at (unsigned int i) { return pages[page_map[i].index]; } 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]; } 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; } 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; } hb_codepoint_t major_start (unsigned int major) const { return major << page_t::PAGE_BITS_LG_2; }
}; };