mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05: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);
|
||||
}
|
||||
|
||||
void
|
||||
grid_row_add_uri_range(struct row *row, struct row_uri_range range)
|
||||
static void
|
||||
ensure_row_has_extra_data(struct row *row)
|
||||
{
|
||||
if (row->extra == NULL)
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue