From 04a028d8c9df9a90bc2c3fe1a15b661a74ba8005 Mon Sep 17 00:00:00 2001 From: Emanuele Giaquinta Date: Sat, 6 Dec 2008 17:02:27 +0000 Subject: [PATCH] Simplify and remove dead code, MAIN_WINDOW_TEXT_HEIGHT(rec) >= WINDOW_MIN_SIZE always holds. git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4948 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-text/mainwindows.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/fe-text/mainwindows.c b/src/fe-text/mainwindows.c index c8b3a3a0..55c87e5c 100644 --- a/src/fe-text/mainwindows.c +++ b/src/fe-text/mainwindows.c @@ -389,7 +389,7 @@ static void mainwindows_resize_smaller(int xdiff, int ydiff) rec = tmp->data; space = MAIN_WINDOW_TEXT_HEIGHT(rec)-WINDOW_MIN_SIZE; - if (space <= 0) { + if (space == 0) { mainwindow_resize(rec, xdiff, 0); rec->first_line += ydiff; @@ -398,7 +398,6 @@ static void mainwindows_resize_smaller(int xdiff, int ydiff) continue; } - if (space <= 0) space = 1; if (space > -ydiff) space = -ydiff; rec->last_line += ydiff; ydiff += space; @@ -428,7 +427,7 @@ static void mainwindows_resize_bigger(int xdiff, int ydiff) MAIN_WINDOW_REC *rec = tmp->data; space = MAIN_WINDOW_TEXT_HEIGHT(rec)-WINDOW_MIN_SIZE; - if (ydiff == 0 || (space >= 0 && tmp->next != NULL)) { + if (ydiff == 0 || tmp->next != NULL) { mainwindow_resize(rec, xdiff, 0); if (moved > 0) { rec->first_line += moved; @@ -438,14 +437,8 @@ static void mainwindows_resize_bigger(int xdiff, int ydiff) continue; } - if (space < 0 && tmp->next != NULL) { - /* space below minimum */ - space = -space; - if (space > ydiff) space = ydiff; - } else { - /* lowest window - give all the extra space for it */ - space = ydiff; - } + /* lowest window - give all the extra space for it */ + space = ydiff; ydiff -= space; rec->first_line += moved; moved += space;