grid: set tp/uri break flags explicitly when we know them to be true

This commit is contained in:
Daniel Eklöf 2021-05-25 19:31:38 +02:00
parent 4b7e4fb885
commit a56b54ad2f
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

18
grid.c
View file

@ -549,26 +549,32 @@ grid_resize_and_reflow(
int uri_col = -1;
int end;
bool tp_break = false;
bool uri_break = false;
if (range != NULL) {
uri_col = (range->start >= start ? range->start : range->end) + 1;
if (tp != NULL) {
tp_col = tp->col + 1;
end = min(tp_col, uri_col);
} else
tp_break = end == tp_col;
uri_break = end == uri_col;
} else {
end = uri_col;
} else if (tp != NULL)
uri_break = true;
}
} else if (tp != NULL) {
end = tp_col = tp->col + 1;
else
tp_break = true;
} else
end = col_count;
int cols = end - start;
xassert(cols > 0);
xassert(start + cols <= old_cols);
bool tp_break = tp_col == end;
bool uri_break = uri_col == end;
for (int count = cols, from = start; count > 0;) {
xassert(new_col_idx <= new_cols);
int new_row_cells_left = new_cols - new_col_idx;