From 51891e8ff42200f0555669c1c8a71e73ddbe189b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 27 Apr 2023 12:16:12 -0600 Subject: [PATCH] [VarComposite] Micro-optimize --- src/OT/glyf/VarCompositeGlyph.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/OT/glyf/VarCompositeGlyph.hh b/src/OT/glyf/VarCompositeGlyph.hh index 335f0a98f..e36682e37 100644 --- a/src/OT/glyf/VarCompositeGlyph.hh +++ b/src/OT/glyf/VarCompositeGlyph.hh @@ -209,7 +209,7 @@ struct VarCompositeGlyphRecord unsigned num_points = get_num_points (); unsigned num_axes = numAxes; - if (unlikely (!points.resize (points.length + num_points))) return false; + if (unlikely (!points.resize (points.length + num_points, false))) return false; unsigned axis_width = (fl & AXIS_INDICES_ARE_SHORT) ? 2 : 1; unsigned axes_size = num_axes * axis_width; @@ -219,6 +219,7 @@ struct VarCompositeGlyphRecord &StructAfter (numAxes)); contour_point_t *rec_points = points.as_array ().sub_array (points.length - num_points).arrayZ; + memset (rec_points, 0, num_points * sizeof (rec_points[0])); unsigned count = num_axes; if (fl & AXES_HAVE_VARIATION)