diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2024-06-23 23:50:52 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2024-06-26 16:39:24 +0000 |
| commit | 08138e9546a00736d6dab6197070f5455d4d7f8c (patch) | |
| tree | bc00b6c0492bb063a2eb0523c96daee6429a57af | |
| parent | changelog: styled + colored underlines (diff) | |
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.
| -rw-r--r-- | render.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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: |
