osc8: uri ranges: use a dynamically re-sizable array instead of a tllist

This commit is contained in:
Daniel Eklöf 2021-11-26 19:55:27 +01:00
parent b1043a72f8
commit ccee08a393
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 319 additions and 123 deletions

13
grid.h
View file

@ -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;
}