[sorted-array] Add faster iterator implementation here as well

This commit is contained in:
Behdad Esfahbod 2022-11-21 12:11:30 -07:00
parent 7cc79a8a86
commit b00a911fa7
1 changed files with 5 additions and 0 deletions

View File

@ -327,6 +327,11 @@ struct hb_sorted_array_t :
bool operator != (const hb_sorted_array_t& o) const bool operator != (const hb_sorted_array_t& o) const
{ return this->arrayZ != o.arrayZ || this->length != o.length; } { return this->arrayZ != o.arrayZ || this->length != o.length; }
/* Faster range-based for loop without bounds-check. */
Type *begin () const { return this->arrayZ; }
Type *end () const { return this->arrayZ + this->length; }
hb_sorted_array_t sub_array (unsigned int start_offset, unsigned int *seg_count /* IN/OUT */) const hb_sorted_array_t sub_array (unsigned int start_offset, unsigned int *seg_count /* IN/OUT */) const
{ return hb_sorted_array_t (((const hb_array_t<Type> *) (this))->sub_array (start_offset, seg_count)); } { return hb_sorted_array_t (((const hb_array_t<Type> *) (this))->sub_array (start_offset, seg_count)); }
hb_sorted_array_t sub_array (unsigned int start_offset, unsigned int seg_count) const hb_sorted_array_t sub_array (unsigned int start_offset, unsigned int seg_count) const