[bit-set] Don't clear pages when copying set

This commit is contained in:
Behdad Esfahbod 2022-12-04 12:22:17 -07:00
parent f5307c3ba8
commit b182e2808a
1 changed files with 3 additions and 3 deletions

View File

@ -85,10 +85,10 @@ struct hb_bit_set_t
void err () { if (successful) successful = false; } /* TODO Remove */ void err () { if (successful) successful = false; } /* TODO Remove */
bool in_error () const { return !successful; } bool in_error () const { return !successful; }
bool resize (unsigned int count) bool resize (unsigned int count, bool clear = true)
{ {
if (unlikely (!successful)) return false; if (unlikely (!successful)) return false;
if (unlikely (!pages.resize (count) || !page_map.resize (count))) if (unlikely (!pages.resize (count, clear) || !page_map.resize (count, clear)))
{ {
pages.resize (page_map.length); pages.resize (page_map.length);
successful = false; successful = false;
@ -350,7 +350,7 @@ struct hb_bit_set_t
{ {
if (unlikely (!successful)) return; if (unlikely (!successful)) return;
unsigned int count = other.pages.length; unsigned int count = other.pages.length;
if (unlikely (!resize (count))) if (unlikely (!resize (count, false)))
return; return;
population = other.population; population = other.population;