From 95bfa0913da18bc752030ca814c9339bbc76159b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 27 Jun 2022 12:09:42 -0600 Subject: [PATCH] [gvar] Optimize translate() --- src/hb-ot-var-gvar-table.hh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-var-gvar-table.hh b/src/hb-ot-var-gvar-table.hh index 1f5b22902..5af6d3d39 100644 --- a/src/hb-ot-var-gvar-table.hh +++ b/src/hb-ot-var-gvar-table.hh @@ -84,8 +84,10 @@ struct contour_point_vector_t : hb_vector_t { if (delta.x == 0.f && delta.y == 0.f) return; - for (unsigned int i = 0; i < length; i++) - (*this)[i].translate (delta); + auto arrayZ = this->arrayZ; + unsigned count = length; + for (unsigned i = 0; i < count; i++) + arrayZ[i].translate (delta); } };