чување d329da0530f307e56cda79d46808b65edf380b73
родитељ c38792a9e0d21d99b08aa3a90e1947071778174f
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Sun, 28 Nov 2021 00:22:32 +0100
poe.c: Small optimization of width/height recalculation logic
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
измењених датотека: 1, додавања: 2(+), брисања: 5(-)
diff --git a/poe.c b/poe.c
@@ -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]);