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

View File

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