[map] Fix resize

This commit is contained in:
Behdad Esfahbod 2018-05-29 18:32:57 -07:00
parent efbab6ba3f
commit a244434622
1 changed files with 4 additions and 3 deletions

View File

@ -110,9 +110,10 @@ struct hb_map_t
items = new_items; items = new_items;
/* Insert back old items. */ /* Insert back old items. */
for (unsigned int i = 0; i < old_size; i++) if (old_items)
if (old_items[i].key != INVALID && old_items[i].value != INVALID) for (unsigned int i = 0; i < old_size; i++)
set (old_items[i].key, old_items[i].value); if (old_items[i].key != INVALID && old_items[i].value != INVALID)
set (old_items[i].key, old_items[i].value);
free (old_items); free (old_items);