[vector] Remove a for loop

This commit is contained in:
Behdad Esfahbod 2022-11-18 16:51:24 -07:00
parent afd9a58bd7
commit bc8eded296
1 changed files with 2 additions and 1 deletions

View File

@ -232,9 +232,10 @@ struct hb_vector_t
if (likely (new_array)) if (likely (new_array))
{ {
for (unsigned i = 0; i < length; i++) for (unsigned i = 0; i < length; i++)
{
new (std::addressof (new_array[i])) Type (); new (std::addressof (new_array[i])) Type ();
for (unsigned i = 0; i < (unsigned) length; i++)
new_array[i] = std::move (arrayZ[i]); new_array[i] = std::move (arrayZ[i]);
}
unsigned old_length = length; unsigned old_length = length;
shrink_vector (0); shrink_vector (0);
length = old_length; length = old_length;