From 6292d451cf710f3f5877f277d7345810233de4b1 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 11 Sep 2015 13:02:14 +0100 Subject: [PATCH] Small code cleanup in ncurses_ui.cc --- src/ncurses_ui.cc | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/ncurses_ui.cc b/src/ncurses_ui.cc index a20268b7..0dc90807 100644 --- a/src/ncurses_ui.cc +++ b/src/ncurses_ui.cc @@ -454,17 +454,9 @@ void NCursesUI::check_resize(bool force) winsize ws; if (ioctl(fd, TIOCGWINSZ, (void*)&ws) == 0) { - auto delete_win = [](NCursesWin*& win) { - if (win) - { - delwin(win); - win = nullptr; - } - }; - - delete_win(m_window); - delete_win(m_info.win); - delete_win(m_menu.win); + if (m_window) delwin(m_window); + if (m_info) m_info.destroy(); + if (m_menu) m_menu.destroy(); resize_term(ws.ws_row, ws.ws_col);