grid: refactor: remove union range_data_for_insertion

This union is identical to row_range_data, except the URI char pointer
is const. Let's ignore that, and re-use row_range_data, casting the
URI pointer when necessary.

Also remove uri_range_insert() and curly_range_insert(), and use the
generic version of range_insert() everywhere.
This commit is contained in:
Daniel Eklöf 2024-06-25 10:26:07 +02:00
parent 6a0110446c
commit 45f4eb48fb
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 33 additions and 51 deletions

View file

@ -129,8 +129,14 @@ struct row_range {
int end;
union {
struct uri_range_data uri;
struct curly_range_data curly;
/* This is just an expanded union row_range_data, but
* anonymous, so that we don't have to write range->u.uri.id,
* but can instead do range->uri.id */
union {
struct uri_range_data uri;
struct curly_range_data curly;
};
union row_range_data data;
};
};