[binutils-gdb] [gdb/tui] Remove unnecessary nullptr check in tui_rl_other_window

Tom de Vries via Gdb-cvs <[email protected]>
Newsgroups gmane.comp.gdb.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d34120c4be9b65f057e80d1bd364c248c12a6f67

commit d34120c4be9b65f057e80d1bd364c248c12a6f67
Author: Tom de Vries <[email protected]>
Date:   Thu Mar 19 10:55:46 2026 +0100

    [gdb/tui] Remove unnecessary nullptr check in tui_rl_other_window
    
    In tui_rl_other_window, we check for win_info != nullptr:
    ...
      win_info = tui_next_win (tui_win_with_focus ());
      if (win_info)
        tui_set_win_focus_to (win_info);
    ...
    but that's also done in tui_set_win_focus_to, so drop it here.
    
    Tested on x86_64-linux.
    
    Reviewed-By: Keith Seitz <[email protected]>

Diff:
---
 gdb/tui/tui.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
index 181d5ef4fd6..731543e2e18 100644
--- a/gdb/tui/tui.c
+++ b/gdb/tui/tui.c
@@ -213,14 +213,11 @@ tui_rl_delete_other_windows (int notused1, int notused2)
 static int
 tui_rl_other_window (int count, int key)
 {
-  struct tui_win_info *win_info;
-
   if (!tui_active)
     tui_rl_switch_mode (0 /* notused */, 0 /* notused */);
 
-  win_info = tui_next_win (tui_win_with_focus ());
-  if (win_info)
-    tui_set_win_focus_to (win_info);
+  tui_set_win_focus_to (tui_next_win (tui_win_with_focus ()));
+
   return 0;
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.