Revert "[glyf] Micro-optimize"

This reverts commit 2bbb605d08.

In case of phantoms_only we were leaving array uninitialized.
This is why the fedora-valgrind bot broke.
This commit is contained in:
Behdad Esfahbod committed 2023-04-27 13:14:52 -06:00
1 parent 1c4e7e4f7e
commit a4b4536a17
1 file changed
+1 -3
+1 -3
View File
@@ -191,11 +191,9 @@ struct SimpleGlyph
unsigned int num_points = endPtsOfContours[num_contours - 1] + 1;
points_.alloc (num_points + 4, true); // Allocate for phantom points, to avoid a possible copy
if (!points_.resize (num_points, false)) return false;
if (!points_.resize (num_points)) return false;
if (phantom_only) return true;
for (unsigned i = 0; i < points_.length; i++)
points_.arrayZ[i].is_end_point = false;
for (int i = 0; i < num_contours; i++)
points_[endPtsOfContours[i]].is_end_point = true;