vteaccess: inefficient per-byte loops
@egmontkob
Submitted by Egmont Koblinger Link to original bug (#734195)
Description
vteaccess.c contains inefficient and hard-to-read loops like
/* Find the first byte that scrolled off. */
for (i = 0; i `< priv->`snapshot_attributes->len; i++) {
attr = g_array_index(priv->snapshot_attributes,
struct _VteCharAttributes,
i);
if (attr.row >= delta + row_count - howmuch) {
break;
}
}
whereas there's a snapshot_linebreaks array, getting the value of "i" should be a direct lookup to this array, shouldn't it?
Version: 0.37.x