This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 02/14] Remove NULL check from tui_reg_command
- From: Tom Tromey <tom at tromey dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tom at tromey dot com>
- Date: Sun, 18 Aug 2019 11:27:23 -0600
- Subject: [PATCH 02/14] Remove NULL check from tui_reg_command
- References: <20190818172735.17477-1-tom@tromey.com>
tui_reg_command has an unnecessary NULL check. The preceding call to
tui_reg_layout will ensure the window exists. This patch removes the
check.
gdb/ChangeLog
2019-08-18 Tom Tromey <tom@tromey.com>
* tui/tui-regs.c (tui_reg_command): Remove NULL check.
---
gdb/ChangeLog | 4 ++++
gdb/tui/tui-regs.c | 4 +---
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c
index 8fcb7bc46bc..b3c7ce627b4 100644
--- a/gdb/tui/tui-regs.c
+++ b/gdb/tui/tui-regs.c
@@ -669,9 +669,7 @@ tui_reg_command (const char *args, int from_tty)
if (TUI_DATA_WIN == NULL || !TUI_DATA_WIN->is_visible ())
tui_reg_layout ();
- struct reggroup *current_group = NULL;
- if (TUI_DATA_WIN != NULL)
- current_group = TUI_DATA_WIN->current_group;
+ struct reggroup *current_group = TUI_DATA_WIN->current_group;
if (strncmp (args, "next", len) == 0)
match = tui_reg_next (current_group, gdbarch);
else if (strncmp (args, "prev", len) == 0)
--
2.17.2