From 8e3cfd09e813fc1a2738b0d4d19d15358e438ace Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 30 Jun 2019 23:30:28 -0600 Subject: [PATCH] Simplify tui_gen_win_info::make_visible I noticed that tui_gen_win_info::make_visible was much wordier than it needed to be. This simplifies it. gdb/ChangeLog 2019-07-17 Tom Tromey * tui/tui-wingeneral.c (tui_gen_win_info::make_visible): Simplify. --- gdb/ChangeLog | 5 +++++ gdb/tui/tui-wingeneral.c | 19 +++++++------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index be9bce1dc5e..0de9c33e362 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2019-07-17 Tom Tromey + + * tui/tui-wingeneral.c (tui_gen_win_info::make_visible): + Simplify. + 2019-07-17 Tom Tromey * tui/tui-layout.c (show_source_disasm_command): Simplify window diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c index 3dca621b887..4e6637e8687 100644 --- a/gdb/tui/tui-wingeneral.c +++ b/gdb/tui/tui-wingeneral.c @@ -165,20 +165,15 @@ tui_make_window (struct tui_gen_win_info *win_info, enum tui_box box_it) void tui_gen_win_info::make_visible (bool visible) { + if (is_visible == visible) + return; + is_visible = visible; + if (visible) + tui_make_window (this, (tui_win_is_auxiliary (type) + ? DONT_BOX_WINDOW : BOX_WINDOW)); + else { - if (!is_visible) - { - tui_make_window (this, (tui_win_is_auxiliary (type) - ? DONT_BOX_WINDOW : BOX_WINDOW)); - is_visible = true; - } - } - else if (!visible - && is_visible - && handle != NULL) - { - is_visible = false; tui_delete_win (handle); handle = NULL; } -- 2.30.2