[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);
|
cluster = hb_min (cluster, info[i].cluster);
|
||||||
|
|
||||||
/* Extend end */
|
/* Extend end */
|
||||||
while (end < len && info[end - 1].cluster == info[end].cluster)
|
if (cluster != info[end - 1].cluster)
|
||||||
end++;
|
while (end < len && info[end - 1].cluster == info[end].cluster)
|
||||||
|
end++;
|
||||||
|
|
||||||
/* Extend start */
|
/* Extend start */
|
||||||
while (idx < start && info[start - 1].cluster == info[start].cluster)
|
if (cluster != info[start].cluster)
|
||||||
start--;
|
while (idx < start && info[start - 1].cluster == info[start].cluster)
|
||||||
|
start--;
|
||||||
|
|
||||||
/* If we hit the start of buffer, continue in out-buffer. */
|
/* 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--)
|
for (unsigned int i = out_len; i && out_info[i - 1].cluster == info[start].cluster; i--)
|
||||||
set_cluster (out_info[i - 1], cluster);
|
set_cluster (out_info[i - 1], cluster);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue