From 73c18d1d42792cba70634a0cf8b7324f79c9e701 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 1 Jun 2023 20:06:42 -0600 Subject: [PATCH] [glyf] Micro-optimize padded_offsets --- src/OT/glyf/glyf.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/OT/glyf/glyf.hh b/src/OT/glyf/glyf.hh index ead65290e..e7ca7e78a 100644 --- a/src/OT/glyf/glyf.hh +++ b/src/OT/glyf/glyf.hh @@ -97,7 +97,7 @@ struct glyf hb_vector_t padded_offsets; unsigned num_glyphs = c->plan->num_output_glyphs (); - if (unlikely (!padded_offsets.resize (num_glyphs))) + if (unlikely (!padded_offsets.resize (num_glyphs, false, true))) { hb_font_destroy (font); return false; @@ -116,7 +116,7 @@ struct glyf unsigned max_offset = 0; for (unsigned i = 0; i < num_glyphs; i++) { - padded_offsets[i] = glyphs[i].padded_size (); + padded_offsets.arrayZ[i] = glyphs[i].padded_size (); max_offset += padded_offsets[i]; } @@ -126,7 +126,7 @@ struct glyf if (!use_short_loca) { for (unsigned i = 0; i < num_glyphs; i++) - padded_offsets[i] = glyphs[i].length (); + padded_offsets.arrayZ[i] = glyphs[i].length (); } bool result = glyf_prime->serialize (c->serializer, glyphs.iter (), use_short_loca, c->plan);