Use daggers in a few get_array functions

As I review https://github.com/harfbuzz/harfbuzz/pull/2471
This commit is contained in:
Behdad Esfahbod 2020-06-18 15:12:37 -07:00
parent a512ca8eae
commit 6fbb59aba6
2 changed files with 14 additions and 14 deletions

View File

@ -347,11 +347,12 @@ struct RecordArrayOf : SortedArrayOf<Record<Type>>
unsigned int *record_count /* IN/OUT */, unsigned int *record_count /* IN/OUT */,
hb_tag_t *record_tags /* OUT */) const hb_tag_t *record_tags /* OUT */) const
{ {
if (record_count) { if (record_count)
const Record<Type> *arr = this->sub_array (start_offset, record_count); {
unsigned int count = *record_count; + this->sub_array (start_offset, record_count)
for (unsigned int i = 0; i < count; i++) | hb_map (&Record<Type>::tag)
record_tags[i] = arr[i].tag; | hb_sink (hb_array (record_tags, *record_count))
;
} }
return this->len; return this->len;
} }
@ -464,11 +465,11 @@ struct IndexArray : ArrayOf<Index>
unsigned int *_count /* IN/OUT */, unsigned int *_count /* IN/OUT */,
unsigned int *_indexes /* OUT */) const unsigned int *_indexes /* OUT */) const
{ {
if (_count) { if (_count)
const HBUINT16 *arr = this->sub_array (start_offset, _count); {
unsigned int count = *_count; + this->sub_array (start_offset, _count)
for (unsigned int i = 0; i < count; i++) | hb_sink (hb_array (_indexes, *_count))
_indexes[i] = arr[i]; ;
} }
return this->len; return this->len;
} }

View File

@ -73,10 +73,9 @@ struct AttachList
if (point_count) if (point_count)
{ {
hb_array_t<const HBUINT16> array = points.sub_array (start_offset, point_count); + points.sub_array (start_offset, point_count)
unsigned int count = array.length; | hb_sink (hb_array (point_array, *point_count))
for (unsigned int i = 0; i < count; i++) ;
point_array[i] = array[i];
} }
return points.len; return points.len;