From 690df8a36955390cfd7251a50a2629e64b52bb82 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 24 Nov 2022 14:32:51 -0700 Subject: [PATCH] [bit-set] Micro-optimize prev() --- src/hb-bit-set.hh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hb-bit-set.hh b/src/hb-bit-set.hh index 3eb2c6ece..beeb29995 100644 --- a/src/hb-bit-set.hh +++ b/src/hb-bit-set.hh @@ -663,21 +663,21 @@ struct hb_bit_set_t page_map_t map = {get_major (*codepoint), 0}; unsigned int i; page_map.bfind (map, &i, HB_NOT_FOUND_STORE_CLOSEST); - if (i < page_map.length && page_map[i].major == map.major) + if (i < page_map.length && page_map.arrayZ[i].major == map.major) { - if (pages[page_map[i].index].previous (codepoint)) + if (pages[page_map.arrayZ[i].index].previous (codepoint)) { - *codepoint += page_map[i].major * page_t::PAGE_BITS; + *codepoint += page_map.arrayZ[i].major * page_t::PAGE_BITS; return true; } } i--; for (; (int) i >= 0; i--) { - hb_codepoint_t m = pages[page_map[i].index].get_max (); + hb_codepoint_t m = pages.arrayZ[page_map.arrayZ[i].index].get_max (); if (m != INVALID) { - *codepoint = page_map[i].major * page_t::PAGE_BITS + m; + *codepoint = page_map.arrayZ[i].major * page_t::PAGE_BITS + m; return true; } }