[bit-set] Micro-optimize page_for
This commit is contained in:
parent
b182e2808a
commit
1bd386515c
|
@ -901,7 +901,7 @@ struct hb_bit_set_t
|
||||||
{
|
{
|
||||||
auto &cached_page = page_map.arrayZ[i];
|
auto &cached_page = page_map.arrayZ[i];
|
||||||
if (cached_page.major == major)
|
if (cached_page.major == major)
|
||||||
return &pages[cached_page.index];
|
return &pages.arrayZ[cached_page.index];
|
||||||
}
|
}
|
||||||
|
|
||||||
page_map_t map = {major, pages.length};
|
page_map_t map = {major, pages.length};
|
||||||
|
@ -913,15 +913,15 @@ struct hb_bit_set_t
|
||||||
if (unlikely (!resize (pages.length + 1)))
|
if (unlikely (!resize (pages.length + 1)))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
pages[map.index].init0 ();
|
pages.arrayZ[map.index].init0 ();
|
||||||
memmove (page_map + i + 1,
|
memmove (page_map.arrayZ + i + 1,
|
||||||
page_map + i,
|
page_map.arrayZ + i,
|
||||||
(page_map.length - 1 - i) * page_map.item_size);
|
(page_map.length - 1 - i) * page_map.item_size);
|
||||||
page_map[i] = map;
|
page_map[i] = map;
|
||||||
}
|
}
|
||||||
|
|
||||||
last_page_lookup = i;
|
last_page_lookup = i;
|
||||||
return &pages[page_map[i].index];
|
return &pages.arrayZ[page_map.arrayZ[i].index];
|
||||||
}
|
}
|
||||||
const page_t *page_for (hb_codepoint_t g) const
|
const page_t *page_for (hb_codepoint_t g) const
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue