mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
osc8: uri ranges: use a dynamically re-sizable array instead of a tllist
This commit is contained in:
parent
b1043a72f8
commit
ccee08a393
4 changed files with 319 additions and 123 deletions
13
grid.h
13
grid.h
|
|
@ -88,14 +88,15 @@ grid_row_uri_range_destroy(struct row_uri_range *range)
|
|||
static inline void
|
||||
grid_row_reset_extra(struct row *row)
|
||||
{
|
||||
if (likely(row->extra == NULL))
|
||||
struct row_data *extra = row->extra;
|
||||
|
||||
if (likely(extra == NULL))
|
||||
return;
|
||||
|
||||
tll_foreach(row->extra->uri_ranges, it) {
|
||||
grid_row_uri_range_destroy(&it->item);
|
||||
tll_remove(row->extra->uri_ranges, it);
|
||||
}
|
||||
for (size_t i = 0; i < extra->uri_ranges.count; i++)
|
||||
grid_row_uri_range_destroy(&extra->uri_ranges.v[i]);
|
||||
free(extra->uri_ranges.v);
|
||||
|
||||
free(row->extra);
|
||||
free(extra);
|
||||
row->extra = NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue