term: erase_cell_range: early break out from URI loop

URI ranges are sorted. This means we don’t have to check any more
ranges once we’ve seen one that starts *after* the erase range.

Closes #594
This commit is contained in:
Daniel Eklöf 2021-06-15 16:26:43 +02:00
parent 5caa87adaf
commit 45a04393c4
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -1537,6 +1537,12 @@ erase_cell_range(struct terminal *term, struct row *row, int start, int end)
/* Split up, or remove, URI ranges affected by the erase */
tll_foreach(row->extra->uri_ranges, it) {
if (it->item.start > end) {
/* This range, and all subsequent ranges, start *after*
* the erase range */
break;
}
if (it->item.start < start && it->item.end >= start) {
/*
* URI crosses the erase *start* point.