[05/11] Remove useless "if' from tui-regs.c

Message ID 20200618021523.10681-6-tom@tromey.com
State New
Headers show
Series
  • TUI cleanups
Related show

Commit Message

Tom Tromey June 18, 2020, 2:15 a.m.
tui_data_window::show_register_group had a useless "if" -- the
condition could never be false.  This patch removes it.

2020-06-14  Tom Tromey  <tom@tromey.com>

	* tui/tui-regs.c (tui_data_window::show_register_group): Remove
	useless "if".
---
 gdb/ChangeLog      |  5 +++++
 gdb/tui/tui-regs.c | 11 ++++-------
 2 files changed, 9 insertions(+), 7 deletions(-)

-- 
2.17.2

Patch

diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c
index 39f5d736392..51fc475beda 100644
--- a/gdb/tui/tui-regs.c
+++ b/gdb/tui/tui-regs.c
@@ -257,15 +257,12 @@  tui_data_window::show_register_group (struct reggroup *group,
 	continue;
 
       data_item_win = &m_regs_content[pos];
-      if (data_item_win)
+      if (!refresh_values_only)
 	{
-	  if (!refresh_values_only)
-	    {
-	      data_item_win->item_no = regnum;
-	      data_item_win->highlight = false;
-	    }
-	  tui_get_register (frame, data_item_win, regnum, 0);
+	  data_item_win->item_no = regnum;
+	  data_item_win->highlight = false;
 	}
+      tui_get_register (frame, data_item_win, regnum, 0);
       pos++;
     }
 }