[buffer] Speed up merge_clusters_impl
This commit is contained in:
parent
1930760bc2
commit
ce6440fceb
|
@ -522,15 +522,17 @@ hb_buffer_t::merge_clusters_impl (unsigned int start,
|
|||
cluster = hb_min (cluster, info[i].cluster);
|
||||
|
||||
/* Extend end */
|
||||
while (end < len && info[end - 1].cluster == info[end].cluster)
|
||||
end++;
|
||||
if (cluster != info[end - 1].cluster)
|
||||
while (end < len && info[end - 1].cluster == info[end].cluster)
|
||||
end++;
|
||||
|
||||
/* Extend start */
|
||||
while (idx < start && info[start - 1].cluster == info[start].cluster)
|
||||
start--;
|
||||
if (cluster != info[start].cluster)
|
||||
while (idx < start && info[start - 1].cluster == info[start].cluster)
|
||||
start--;
|
||||
|
||||
/* If we hit the start of buffer, continue in out-buffer. */
|
||||
if (idx == start)
|
||||
if (idx == start && info[start].cluster != cluster)
|
||||
for (unsigned int i = out_len; i && out_info[i - 1].cluster == info[start].cluster; i--)
|
||||
set_cluster (out_info[i - 1], cluster);
|
||||
|
||||
|
|
Loading…
Reference in New Issue