[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) void extend (const hb_array_t<contour_point_t> &a)
{ {
unsigned int old_len = length; unsigned int old_len = length;
resize (old_len + a.length); if (unlikely (!resize (old_len + a.length)))
for (unsigned int i = 0; i < a.length; i++) return;
(*this)[old_len + i] = a[i]; 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]) void transform (const float (&matrix)[4])