render: underlines: minor perf-tweak: early break out

When looking up the extender underline range, break out early if we
see that there can't possibly be any ranges matching the current column.
This commit is contained in:
Daniel Eklöf 2024-06-24 01:50:52 +02:00
parent 0759caec6e
commit 08138e9546
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -971,6 +971,9 @@ render_cell(struct terminal *term, pixman_image_t *pix, pixman_region32_t *damag
for (int i = 0; i < row->extra->curly_ranges.count; i++) {
const struct row_range *range = &row->extra->curly_ranges.v[i];
if (range->start > col)
break;
if (range->start <= col && col <= range->end) {
switch (range->curly.color_src) {
case COLOR_BASE256: