[vector] Comment

This commit is contained in:
Behdad Esfahbod 2022-11-18 17:22:17 -07:00
parent 69b41f92ec
commit bef5a1c8dc
1 changed files with 5 additions and 1 deletions

View File

@ -95,7 +95,11 @@ struct hb_vector_t
void reset ()
{
if (unlikely (in_error ()))
allocated = length; // Big hack!
/* Big Hack! We don't know the true allocated size before
* an allocation failure happened. But we know it was at
* least as big as length. Restore it to that and continue
* as if error did not happen. */
allocated = length;
resize (0);
}