Fix reverse_range() position loop

Mozilla Bug 669175 - Slow rendering of text sometimes in this case,
using direction: rtl
This commit is contained in:
Behdad Esfahbod 2011-07-06 16:05:45 -04:00
parent fa2befa46f
commit 2e18c6dbdf
1 changed files with 5 additions and 2 deletions

View File

@ -535,13 +535,16 @@ hb_buffer_get_glyph_positions (hb_buffer_t *buffer,
}
static void
static inline void
reverse_range (hb_buffer_t *buffer,
unsigned int start,
unsigned int end)
{
unsigned int i, j;
if (start == end - 1)
return;
for (i = start, j = end - 1; i < j; i++, j--) {
hb_glyph_info_t t;
@ -551,7 +554,7 @@ reverse_range (hb_buffer_t *buffer,
}
if (buffer->pos) {
for (i = 0, j = end - 1; i < j; i++, j--) {
for (i = start, j = end - 1; i < j; i++, j--) {
hb_glyph_position_t t;
t = buffer->pos[i];