Remove an unneeded NULL check
authorTom Tromey <tom@tromey.com>
Sun, 16 Jun 2019 20:14:10 +0000 (14:14 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 25 Jun 2019 13:48:32 +0000 (07:48 -0600)
show_source_or_disasm_and_command will either create or reset the
source window, so the final NULL check is not necessary.  This patch
removes it.

gdb/ChangeLog
2019-06-25  Tom Tromey  <tom@tromey.com>

* tui/tui-layout.c (show_source_or_disasm_and_command): Remove
NULL check.

gdb/ChangeLog
gdb/tui/tui-layout.c

index b529085e2308ffc99580db095b99429dc1606856..0e2c74e4e207950ea70299d76231b835fc3250f1 100644 (file)
@@ -1,3 +1,8 @@
+2019-06-25  Tom Tromey  <tom@tromey.com>
+
+       * tui/tui-layout.c (show_source_or_disasm_and_command): Remove
+       NULL check.
+
 2019-06-25  Tom Tromey  <tom@tromey.com>
 
        * tui/tui-data.h (struct tui_data_window, struct tui_cmd_window):
index 72ec924f72c5cc41061a1fae03d10b16ceed1518..de78c6c0ac8fa48727ccd7e853f681fb7f558716 100644 (file)
@@ -945,30 +945,28 @@ show_source_or_disasm_and_command (enum tui_layout_type layout_type)
          tui_make_visible (&(*win_info_ptr)->generic);
          tui_make_visible (base->execution_info);
        }
-      if ((*win_info_ptr) != NULL)
-       {
-         base->m_has_locator = true;
-         tui_make_visible (locator);
-         tui_show_locator_content ();
-         tui_show_source_content (*win_info_ptr);
 
-         if (TUI_CMD_WIN == NULL)
-           {
-             tui_win_list[CMD_WIN] = make_command_window (cmd_height,
-                                                          src_height);
-             tui_refresh_win (&TUI_CMD_WIN->generic);
-           }
-         else
-           {
-             init_gen_win_info (&TUI_CMD_WIN->generic,
-                                TUI_CMD_WIN->generic.type,
-                                TUI_CMD_WIN->generic.height,
-                                TUI_CMD_WIN->generic.width,
-                                TUI_CMD_WIN->generic.origin.x,
-                                TUI_CMD_WIN->generic.origin.y);
-             TUI_CMD_WIN->can_highlight = FALSE;
-             tui_make_visible (&TUI_CMD_WIN->generic);
-           }
+      base->m_has_locator = true;
+      tui_make_visible (locator);
+      tui_show_locator_content ();
+      tui_show_source_content (*win_info_ptr);
+
+      if (TUI_CMD_WIN == NULL)
+       {
+         tui_win_list[CMD_WIN] = make_command_window (cmd_height,
+                                                      src_height);
+         tui_refresh_win (&TUI_CMD_WIN->generic);
+       }
+      else
+       {
+         init_gen_win_info (&TUI_CMD_WIN->generic,
+                            TUI_CMD_WIN->generic.type,
+                            TUI_CMD_WIN->generic.height,
+                            TUI_CMD_WIN->generic.width,
+                            TUI_CMD_WIN->generic.origin.x,
+                            TUI_CMD_WIN->generic.origin.y);
+         TUI_CMD_WIN->can_highlight = FALSE;
+         tui_make_visible (&TUI_CMD_WIN->generic);
        }
       tui_set_current_layout_to (layout_type);
     }