From 821d9e9034c57c5c593741284b134c76cc3c7c0f Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Fri, 26 Jul 2019 00:08:58 +0430 Subject: [PATCH] Use .sub_array for DataMap tags iteration --- src/hb-ot-meta-table.hh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/hb-ot-meta-table.hh b/src/hb-ot-meta-table.hh index 7d60c7662..a7bd7bffc 100644 --- a/src/hb-ot-meta-table.hh +++ b/src/hb-ot-meta-table.hh @@ -82,13 +82,11 @@ struct meta unsigned int *count, hb_ot_metadata_t *entries) const { - unsigned int entries_count = table->dataMaps.len; if (count && *count) { - unsigned int len = hb_min (entries_count - start_offset, *count); - for (unsigned int i = 0; i < len; i++) - entries[i] = (hb_ot_metadata_t) table->dataMaps[i + start_offset].get_tag (); - *count = len; + hb_array_t array = table->dataMaps.sub_array (start_offset, count); + for (unsigned int i = 0; i < *count; i++) + entries[i] = (hb_ot_metadata_t) array[i].get_tag (); } return table->dataMaps.len; }