[66/66] Tidy tui_delete_win

Message ID 20190624184841.3492-17-tom@tromey.com
State New, archived
Headers

Commit Message

Tom Tromey June 24, 2019, 6:48 p.m. UTC
  tui_delete_win does its own NULL check, so ~tui_gen_win_info does not
need to do it.  Also, tui_delete_win has an extraneous "return".

2019-06-23  Tom Tromey  <tom@tromey.com>

	* tui/tui-wingeneral.c (tui_delete_win): Remove "return".
	* tui/tui-data.c (~tui_gen_win_info): Remove "if".
---
 gdb/ChangeLog            | 5 +++++
 gdb/tui/tui-data.c       | 6 +-----
 gdb/tui/tui-wingeneral.c | 2 --
 3 files changed, 6 insertions(+), 7 deletions(-)
  

Patch

diff --git a/gdb/tui/tui-data.c b/gdb/tui/tui-data.c
index 1ecf486e37f..4a16c4f03f2 100644
--- a/gdb/tui/tui-data.c
+++ b/gdb/tui/tui-data.c
@@ -350,11 +350,7 @@  tui_source_window_base::tui_source_window_base (enum tui_win_type type)
 
 tui_gen_win_info::~tui_gen_win_info ()
 {
-  if (handle != NULL)
-    {
-      tui_delete_win (handle);
-      handle = NULL;
-    }
+  tui_delete_win (handle);
   xfree (title);
 }
 
diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c
index 13063ae9356..cf8d9fc3959 100644
--- a/gdb/tui/tui-wingeneral.c
+++ b/gdb/tui/tui-wingeneral.c
@@ -63,8 +63,6 @@  tui_delete_win (WINDOW *window)
 {
   if (window != NULL)
     delwin (window);
-
-  return;
 }