From a56b54ad2f3cc0f5d43a1f32227d4f3867c07867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 25 May 2021 19:31:38 +0200 Subject: [PATCH] grid: set tp/uri break flags explicitly when we know them to be true --- grid.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/grid.c b/grid.c index d318c541..4f1223dc 100644 --- a/grid.c +++ b/grid.c @@ -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;