[array] Use hb_swap() in reverse()

This commit is contained in:
Behdad Esfahbod 2022-07-13 15:13:07 -06:00
parent 87167acfe3
commit 4b3afafb00
1 changed files with 2 additions and 5 deletions

View File

@ -220,11 +220,8 @@ struct hb_array_t : hb_iter_with_fallback_t<hb_array_t<Type>, Type&>
if (end < start + 2)
return;
for (unsigned lhs = start, rhs = end - 1; lhs < rhs; lhs++, rhs--) {
Type temp = arrayZ[rhs];
arrayZ[rhs] = arrayZ[lhs];
arrayZ[lhs] = temp;
}
for (unsigned lhs = start, rhs = end - 1; lhs < rhs; lhs++, rhs--)
hb_swap (arrayZ[rhs], arrayZ[lhs]);
}
hb_array_t sub_array (unsigned int start_offset = 0, unsigned int *seg_count = nullptr /* IN/OUT */) const