From patchwork Thu Mar 30 16:20:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schimpe, Christina" X-Patchwork-Id: 67126 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F154338582BD for ; Thu, 30 Mar 2023 16:20:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F154338582BD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1680193257; bh=rMZLgqqgC7eiOwXnNx6nOHOjp8W8MoC/l8EtPoau5Eo=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=wTATNCHXDwGBw7obPNZkrA1BhuNYr/ELauJPitZKZ3et2XrgLxYSbLY/g6X1zNhxr jhenmrM0U4Ld1ZU+wOK0CZfKcvkvTKYDSCTqzojU/RCZRCYTMbiG+MLV9N9aNDE1zH vOxxfE/VN9oIGXVYt3oT7y6frePUXJrJWkO03Pg4= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by sourceware.org (Postfix) with ESMTPS id 5E87D38582BC for ; Thu, 30 Mar 2023 16:20:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5E87D38582BC X-IronPort-AV: E=McAfee;i="6600,9927,10665"; a="339941769" X-IronPort-AV: E=Sophos;i="5.98,305,1673942400"; d="scan'208";a="339941769" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2023 09:20:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10665"; a="634969592" X-IronPort-AV: E=Sophos;i="5.98,305,1673942400"; d="scan'208";a="634969592" Received: from labpc2315.iul.intel.com (HELO localhost) ([172.28.50.57]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2023 09:20:31 -0700 To: gdb-patches@sourceware.org Cc: Christina Schimpe Subject: [PATCH 1/1] gdb: Remove extra if statement Date: Thu, 30 Mar 2023 18:20:08 +0200 Message-Id: <20230330162008.3126244-2-christina.schimpe@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230330162008.3126244-1-christina.schimpe@intel.com> References: <20230330162008.3126244-1-christina.schimpe@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Christina Schimpe via Gdb-patches From: "Schimpe, Christina" Reply-To: Christina Schimpe Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" From: Ari Hannula The removed if statement is already checked in the parent if else statement. Co-Authored-By: Christina Schimpe --- gdb/thread.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) 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; }