[vector] Allocate exact size in operator=

This commit is contained in:
Behdad Esfahbod 2023-01-01 23:07:42 -07:00
parent 449910d431
commit 55a7d81740
1 changed files with 1 additions and 1 deletions

View File

@ -116,7 +116,7 @@ struct hb_vector_t
hb_vector_t& operator = (const hb_vector_t &o) hb_vector_t& operator = (const hb_vector_t &o)
{ {
reset (); reset ();
alloc (o.length); alloc (o.length, true);
if (unlikely (in_error ())) return *this; if (unlikely (in_error ())) return *this;
copy_vector (o); copy_vector (o);