diff --git a/src/hb-bit-set.hh b/src/hb-bit-set.hh index 00eda5aec..475b07b81 100644 --- a/src/hb-bit-set.hh +++ b/src/hb-bit-set.hh @@ -88,6 +88,10 @@ struct hb_bit_set_t bool resize (unsigned int count, bool clear = true, bool exact_size = false) { if (unlikely (!successful)) return false; + + if (pages.length == 0 && count == 1) + exact_size = true; // Most sets are small and local + if (unlikely (!pages.resize (count, clear, exact_size) || !page_map.resize (count, clear, exact_size))) { pages.resize (page_map.length, clear, exact_size);