diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-11-20 14:46:20 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-11-21 17:09:27 +0000 |
| commit | f27ccd999ef6fcf10f99aed9f6aec449fe071551 (patch) | |
| tree | 9337dbc8c2daa3effd1d34bfdf3a86d41985b8a0 /spawn.c | |
| parent | grid: row_uri_range_erase(): assume caller has checked row->extra != NULL (diff) | |
grid: refactor grid_row_uri_range_erase()
The old algorithm always created a new URI, followed by (maybe)
removing the existing URI, when an URI needed to be modified.
That is, if e.g. the tail of an URI was being erased, the old
algorithm would create a new URI for the part of the URI that should
remain, and then removed the old URI.
This isn’t very effective. The new algorithm instead identifies all
possible overlap cases, and handles each one differently:
* URI ends *before* erase range starts - continue with the next URI
without further checks
* URI starts *after* the erase range ends - return, we’re done
* Erase range erases the entire URI - remove the URI
* Erase range erases a part in the middle - split the URI
* Erase range erases the head of the URI - adjust the URI’s start
* Erase range erases the tail of the URI - adjust the URI’s end
Diffstat (limited to 'spawn.c')
0 files changed, 0 insertions, 0 deletions
