mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-22 05:33:45 -04:00
grid: refactor: break out allocation of ‘extra’ member to separate function
This commit is contained in:
parent
7f13d0084e
commit
a0b977fcee
1 changed files with 7 additions and 2 deletions
9
grid.c
9
grid.c
|
|
@ -580,11 +580,16 @@ grid_resize_and_reflow(
|
||||||
tll_free(tracking_points);
|
tll_free(tracking_points);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
grid_row_add_uri_range(struct row *row, struct row_uri_range range)
|
ensure_row_has_extra_data(struct row *row)
|
||||||
{
|
{
|
||||||
if (row->extra == NULL)
|
if (row->extra == NULL)
|
||||||
row->extra = xcalloc(1, sizeof(*row->extra));
|
row->extra = xcalloc(1, sizeof(*row->extra));
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
grid_row_add_uri_range(struct row *row, struct row_uri_range range)
|
||||||
|
{
|
||||||
|
ensure_row_has_extra_data(row);
|
||||||
tll_push_back(row->extra->uri_ranges, range);
|
tll_push_back(row->extra->uri_ranges, range);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue