mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
grid: reflow: avoid unnecessary if-statements before chunking a row
This commit is contained in:
parent
2029d201b5
commit
c2314d689e
1 changed files with 13 additions and 8 deletions
21
grid.c
21
grid.c
|
|
@ -533,16 +533,21 @@ grid_resize_and_reflow(
|
|||
|
||||
xassert(col_count >= 0 && col_count <= old_cols);
|
||||
|
||||
struct coord *tp = (*next_tp)->row == old_row_idx ? *next_tp : NULL;
|
||||
struct row_uri_range *range =
|
||||
old_row->extra != NULL && tll_length(old_row->extra->uri_ranges) > 0
|
||||
? &tll_front(old_row->extra->uri_ranges)
|
||||
: NULL;
|
||||
|
||||
if (tp != NULL)
|
||||
/* Do we have a (at least one) tracking point on this row */
|
||||
struct coord *tp;
|
||||
if ((*next_tp)->row == old_row_idx) {
|
||||
tp = *next_tp;
|
||||
col_count = max(col_count, tp->col + 1);
|
||||
if (range != NULL)
|
||||
} else
|
||||
tp = NULL;
|
||||
|
||||
/* Does this row have any URIs? */
|
||||
struct row_uri_range *range;
|
||||
if (old_row->extra != NULL && tll_length(old_row->extra->uri_ranges) > 0) {
|
||||
range = &tll_front(old_row->extra->uri_ranges);
|
||||
col_count = max(col_count, range->end + 1);
|
||||
} else
|
||||
range = NULL;
|
||||
|
||||
for (int start = 0, left = col_count; left > 0;) {
|
||||
int end;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue