From 20b32b049bad64d802b33979372c8cdc5a0c4cb4 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 29 Jun 2023 12:08:11 -0600 Subject: [PATCH] [SimpleGlyph] Micro-optimize phantom_only --- src/OT/glyf/SimpleGlyph.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/OT/glyf/SimpleGlyph.hh b/src/OT/glyf/SimpleGlyph.hh index cdf30d628..a0157d8ec 100644 --- a/src/OT/glyf/SimpleGlyph.hh +++ b/src/OT/glyf/SimpleGlyph.hh @@ -194,7 +194,8 @@ struct SimpleGlyph points.alloc (points.length + num_points + 4, true); // Allocate for phantom points, to avoid a possible copy if (unlikely (!points.resize (points.length + num_points, false))) return false; auto points_ = points.as_array ().sub_array (old_length); - hb_memset (points_.arrayZ, 0, sizeof (contour_point_t) * num_points); + if (!phantom_only) + hb_memset (points_.arrayZ, 0, sizeof (contour_point_t) * num_points); if (phantom_only) return true; for (int i = 0; i < num_contours; i++)