diff options
author | Tom Tromey <tom@tromey.com> | 2019-06-30 23:30:28 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-07-17 12:19:16 -0600 |
commit | 8e3cfd09e813fc1a2738b0d4d19d15358e438ace (patch) | |
tree | a182b058cb798f2192043d9acc7b05aac94d1e3a /gdb/tui | |
parent | f4e049775aa3b025501d6b4aae1cdb975505a767 (diff) | |
download | gdb-8e3cfd09e813fc1a2738b0d4d19d15358e438ace.zip gdb-8e3cfd09e813fc1a2738b0d4d19d15358e438ace.tar.gz gdb-8e3cfd09e813fc1a2738b0d4d19d15358e438ace.tar.bz2 |
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 <tom@tromey.com>
* tui/tui-wingeneral.c (tui_gen_win_info::make_visible):
Simplify.
Diffstat (limited to 'gdb/tui')
-rw-r--r-- | gdb/tui/tui-wingeneral.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c index 3dca621..4e6637e 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; } |