From c49ca371151ef3afc3a4ecf0b8918cdd8ac16541 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 29 Jun 2023 12:38:45 -0600 Subject: [PATCH] [Glyph] Minor micro-optimize away a function call For when coords are not set. --- src/OT/glyf/Glyph.hh | 9 +++++---- src/hb-ot-var-gvar-table.hh | 2 -- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/OT/glyf/Glyph.hh b/src/OT/glyf/Glyph.hh index d7482bbc8..1fed0ae9c 100644 --- a/src/OT/glyf/Glyph.hh +++ b/src/OT/glyf/Glyph.hh @@ -371,10 +371,11 @@ struct Glyph } #ifndef HB_NO_VAR - glyf_accelerator.gvar->apply_deltas_to_points (gid, - coords, - points.as_array ().sub_array (old_length), - phantom_only); + if (coords) + glyf_accelerator.gvar->apply_deltas_to_points (gid, + coords, + points.as_array ().sub_array (old_length), + phantom_only); #endif // mainly used by CompositeGlyph calculating new X/Y offset value so no need to extend it diff --git a/src/hb-ot-var-gvar-table.hh b/src/hb-ot-var-gvar-table.hh index 9bc8c1006..094a32e41 100644 --- a/src/hb-ot-var-gvar-table.hh +++ b/src/hb-ot-var-gvar-table.hh @@ -294,8 +294,6 @@ struct gvar const hb_array_t points, bool phantom_only = false) const { - if (!coords) return true; - if (unlikely (glyph >= glyphCount)) return true; hb_bytes_t var_data_bytes = table->get_glyph_var_data_bytes (table.get_blob (), glyphCount, glyph);