[buffer] Inline revers_range() / reverse()

This commit is contained in:
Behdad Esfahbod 2021-12-10 12:33:21 -07:00
parent 5914acb3cb
commit 4cd96e73e4
2 changed files with 8 additions and 25 deletions

View File

@ -395,29 +395,6 @@ hb_buffer_t::set_masks (hb_mask_t value,
info[i].mask = (info[i].mask & not_mask) | value;
}
void
hb_buffer_t::reverse_range (unsigned int start,
unsigned int end)
{
if (end - start < 2)
return;
hb_array_t<hb_glyph_info_t> (info, len).reverse (start, end);
if (have_positions) {
hb_array_t<hb_glyph_position_t> (pos, len).reverse (start, end);
}
}
void
hb_buffer_t::reverse ()
{
if (unlikely (!len))
return;
reverse_range (0, len);
}
void
hb_buffer_t::reverse_clusters ()
{

View File

@ -201,8 +201,14 @@ struct hb_buffer_t
unsigned int cluster);
HB_INTERNAL void add_info (const hb_glyph_info_t &glyph_info);
HB_INTERNAL void reverse_range (unsigned int start, unsigned int end);
HB_INTERNAL void reverse ();
void reverse_range (unsigned start, unsigned end)
{
hb_array_t<hb_glyph_info_t> (info, len).reverse (start, end);
if (have_positions)
hb_array_t<hb_glyph_position_t> (pos, len).reverse (start, end);
}
void reverse () { reverse_range (0, len); }
HB_INTERNAL void reverse_clusters ();
HB_INTERNAL void guess_segment_properties ();