Use .sub_array for DataMap tags iteration

This commit is contained in:
Ebrahim Byagowi 2019-07-26 00:08:58 +04:30 committed by Behdad Esfahbod
parent a250af98ae
commit 821d9e9034
1 changed files with 3 additions and 5 deletions

View File

@ -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<const DataMap> 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;
}