[1/1] gdb: Remove extra if statement

Message ID 20230330162008.3126244-2-christina.schimpe@intel.com
State New
Headers
Series Remove extra if statement |

Commit Message

Schimpe, Christina March 30, 2023, 4:20 p.m. UTC
  From: Ari Hannula <ari.hannula@intel.com>

The removed if statement is already checked in the parent if else
statement.

Co-Authored-By: Christina Schimpe <christina.schimpe@intel.com>
---
 gdb/thread.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)
  

Comments

Simon Marchi March 30, 2023, 5:58 p.m. UTC | #1
On 3/30/23 12:20, Christina Schimpe via Gdb-patches wrote:
> From: Ari Hannula <ari.hannula@intel.com>
> 
> The removed if statement is already checked in the parent if else
> statement.
> 
> Co-Authored-By: Christina Schimpe <christina.schimpe@intel.com>

Thanks:

Approved-By: Simon Marchi <simon.marchi@efficios.com>

Simon
  
Terekhov, Mikhail via Gdb-patches March 31, 2023, 2:26 p.m. UTC | #2
I pushed this.

Thanks,
Christina

> -----Original Message-----
> From: Simon Marchi <simark@simark.ca>
> Sent: Thursday, March 30, 2023 7:58 PM
> To: Schimpe, Christina <christina.schimpe@intel.com>; gdb-
> patches@sourceware.org
> Subject: Re: [PATCH 1/1] gdb: Remove extra if statement
> 
> On 3/30/23 12:20, Christina Schimpe via Gdb-patches wrote:
> > From: Ari Hannula <ari.hannula@intel.com>
> >
> > The removed if statement is already checked in the parent if else
> > statement.
> >
> > Co-Authored-By: Christina Schimpe <christina.schimpe@intel.com>
> 
> Thanks:
> 
> Approved-By: Simon Marchi <simon.marchi@efficios.com>
> 
> Simon
Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
  

Patch

diff --git a/gdb/thread.c b/gdb/thread.c
index 3d4cba32303..25d97cd6072 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -1083,16 +1083,13 @@  print_thread_info_1 (struct ui_out *uiout, const char *requested_threads,
 				      global_ids, pid, tp))
 	      continue;
 
-	    if (!uiout->is_mi_like_p ())
-	      {
-		/* Switch inferiors so we're looking at the right
-		   target stack.  */
-		switch_to_inferior_no_thread (tp->inf);
-
-		target_id_col_width
-		  = std::max (target_id_col_width,
-			      thread_target_id_str (tp).size ());
-	      }
+	    /* Switch inferiors so we're looking at the right
+	       target stack.  */
+	    switch_to_inferior_no_thread (tp->inf);
+
+	    target_id_col_width
+	      = std::max (target_id_col_width,
+			  thread_target_id_str (tp).size ());
 
 	    ++n_threads;
 	  }