From d515630f6bb68624dfb67587f92d5cb383970408 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 3 Apr 2025 22:31:13 -0600 Subject: [PATCH] [shape-font] Simplify logic --- src/hb-ot-shape.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index e7a594371..a2d2edee9 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -431,8 +431,11 @@ struct hb_ot_font_data_t { hb_ot_font_data_t * _hb_ot_shaper_font_data_create (hb_font_t *font) { + if (!font->num_coords) + return (hb_ot_font_data_t *) HB_SHAPER_DATA_SUCCEEDED; + const OT::ItemVariationStore &var_store = font->face->table.GDEF->table->get_var_store (); - auto *cache = font->num_coords ? (hb_ot_font_data_t *) var_store.create_cache () : nullptr; + auto *cache = (hb_ot_font_data_t *) var_store.create_cache (); return cache ? cache : (hb_ot_font_data_t *) HB_SHAPER_DATA_SUCCEEDED; }