[map] Fix size calculation

Don't know why I thought I should subtract one there...
This commit is contained in:
Behdad Esfahbod 2018-05-30 14:02:49 -07:00
parent ff92de766b
commit b3d45de6cf
1 changed files with 1 additions and 1 deletions

View File

@ -90,7 +90,7 @@ struct hb_map_t
{ {
if (unlikely (in_error)) return false; if (unlikely (in_error)) return false;
unsigned int power = _hb_bit_storage (population * 2 + 8) - 1; unsigned int power = _hb_bit_storage (population * 2 + 8);
unsigned int new_size = 1u << power; unsigned int new_size = 1u << power;
item_t *new_items = (item_t *) malloc ((size_t) new_size * sizeof (item_t)); item_t *new_items = (item_t *) malloc ((size_t) new_size * sizeof (item_t));
if (unlikely (!new_items)) if (unlikely (!new_items))