~strahinja/poe

d329da0530f307e56cda79d46808b65edf380b73 — Страхиња Радић a month ago c38792a
poe.c: Small optimization of width/height recalculation logic

Signed-off-by: Страхиња Радић <contact@strahinja.org>
1 files changed, 2 insertions(+), 5 deletions(-)

M poe.c
M poe.c => poe.c +2 -5
@@ 2221,11 2221,9 @@ main(int argc, char** argv)

	while (state.running)
	{
		int maxx = tb_width();
		int maxy = tb_height();

		tb_clear();

		int maxx = tb_width();
		if (maxx != state.maxx)
		{
			state.maxx	   = maxx;


@@ 2233,8 2231,7 @@ main(int argc, char** argv)
			state.edit_width   = calculate_edit_width(&state);
			state.search_width = calculate_search_width(&state);
		}
		if (maxy != state.maxy)
			state.maxy = maxy;
		state.maxy = tb_height();

		if (!draw(&state))
			strcpy(state.error, errors[ERR_CANT_ALLOC]);