diff --git a/src/hb-array.hh b/src/hb-array.hh index 96d2e0a97..51994947e 100644 --- a/src/hb-array.hh +++ b/src/hb-array.hh @@ -181,6 +181,8 @@ struct hb_array_t : hb_iter_with_fallback_t, Type&> hb_array_t sub_array (unsigned int start_offset, unsigned int seg_count) const { return sub_array (start_offset, &seg_count); } + hb_array_t truncate (unsigned length) const { return sub_array (0, length); } + template @@ -263,6 +265,8 @@ struct hb_sorted_array_t : hb_sorted_array_t sub_array (unsigned int start_offset, unsigned int seg_count) const { return sub_array (start_offset, &seg_count); } + hb_sorted_array_t truncate (unsigned length) const { return sub_array (0, length); } + template Type *bsearch (const T &x, Type *not_found = nullptr) {