From 42615561b545f2bb7c29618884fa2d63d8dd97a8 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 26 Nov 2022 17:10:58 -0700 Subject: [PATCH] Optimize a couple array references --- src/hb-ot-map.cc | 2 +- src/hb-subset-cff-common.hh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hb-ot-map.cc b/src/hb-ot-map.cc index 5836457fe..8882dbacc 100644 --- a/src/hb-ot-map.cc +++ b/src/hb-ot-map.cc @@ -214,7 +214,7 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m, if (feature_infos.length) { feature_infos.qsort (); - auto &f = feature_infos.arrayZ; + auto *f = feature_infos.arrayZ; unsigned int j = 0; unsigned count = feature_infos.length; for (unsigned int i = 1; i < count; i++) diff --git a/src/hb-subset-cff-common.hh b/src/hb-subset-cff-common.hh index 2e98b4a26..8fed0231e 100644 --- a/src/hb-subset-cff-common.hh +++ b/src/hb-subset-cff-common.hh @@ -119,7 +119,7 @@ struct str_encoder_t return; /* Faster than hb_memcpy for small strings. */ - auto arr = buff.arrayZ + offset; + auto *arr = buff.arrayZ + offset; /* Length is at least one; and mostly just one. */ arr[0] = str[0]; for (unsigned i = 1; i < length; i++) @@ -1008,7 +1008,7 @@ struct subr_subsetter_t if (str.prefix_op () != OpCode_Invalid) encoder.encode_op (str.prefix_op ()); } - auto &arr = str.values.arrayZ; + auto *arr = str.values.arrayZ; for (unsigned int i = 0; i < count; i++) { const parsed_cs_op_t &opstr = arr[i];