[glyf] Optimize hb_contour_points_t::extend

This commit is contained in:
Behdad Esfahbod 2022-06-27 11:55:37 -06:00
parent 98fbe87a26
commit 75ca78a6bb
1 changed files with 6 additions and 3 deletions

View File

@ -56,9 +56,12 @@ struct contour_point_vector_t : hb_vector_t<contour_point_t>
void extend (const hb_array_t<contour_point_t> &a)
{
unsigned int old_len = length;
resize (old_len + a.length);
for (unsigned int i = 0; i < a.length; i++)
(*this)[old_len + i] = a[i];
if (unlikely (!resize (old_len + a.length)))
return;
auto arrayZ = this->arrayZ + old_len;
unsigned count = a.length;
for (unsigned int i = 0; i < count; i++)
arrayZ[i] = a.arrayZ[i];
}
void transform (const float (&matrix)[4])