When merging clusters, extend the end

This commit is contained in:
Behdad Esfahbod 2012-06-08 20:17:10 -04:00
parent 28ce5fa454
commit cafa6f3727
1 changed files with 14 additions and 6 deletions

View File

@ -424,23 +424,31 @@ void
hb_buffer_t::merge_clusters (unsigned int start,
unsigned int end)
{
unsigned int cluster = this->info[start].cluster;
if (unlikely (start >= end))
return;
unsigned int cluster = info[start].cluster;
for (unsigned int i = start + 1; i < end; i++)
cluster = MIN (cluster, this->info[i].cluster);
cluster = MIN (cluster, info[i].cluster);
/* Extend end */
while (end < len && info[end - 1].cluster == info[end].cluster)
end++;
for (unsigned int i = start; i < end; i++)
this->info[i].cluster = cluster;
info[i].cluster = cluster;
}
void
hb_buffer_t::merge_out_clusters (unsigned int start,
unsigned int end)
{
unsigned int cluster = this->out_info[start].cluster;
unsigned int cluster = out_info[start].cluster;
for (unsigned int i = start + 1; i < end; i++)
cluster = MIN (cluster, this->out_info[i].cluster);
cluster = MIN (cluster, out_info[i].cluster);
for (unsigned int i = start; i < end; i++)
this->out_info[i].cluster = cluster;
out_info[i].cluster = cluster;
}
void