提交 821d9e90 编写于 作者: E Ebrahim Byagowi 提交者: Behdad Esfahbod

Use .sub_array for DataMap tags iteration

上级 a250af98
...@@ -82,13 +82,11 @@ struct meta ...@@ -82,13 +82,11 @@ struct meta
unsigned int *count, unsigned int *count,
hb_ot_metadata_t *entries) const hb_ot_metadata_t *entries) const
{ {
unsigned int entries_count = table->dataMaps.len;
if (count && *count) if (count && *count)
{ {
unsigned int len = hb_min (entries_count - start_offset, *count); hb_array_t<const DataMap> array = table->dataMaps.sub_array (start_offset, count);
for (unsigned int i = 0; i < len; i++) for (unsigned int i = 0; i < *count; i++)
entries[i] = (hb_ot_metadata_t) table->dataMaps[i + start_offset].get_tag (); entries[i] = (hb_ot_metadata_t) array[i].get_tag ();
*count = len;
} }
return table->dataMaps.len; return table->dataMaps.len;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册