From patchwork Sun Jan 19 16:10:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 37441 Received: (qmail 65004 invoked by alias); 19 Jan 2020 16:11:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 64996 invoked by uid 89); 19 Jan 2020 16:11:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_SOFTFAIL autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: barracuda.ebox.ca Received: from barracuda.ebox.ca (HELO barracuda.ebox.ca) (96.127.255.19) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 19 Jan 2020 16:11:02 +0000 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id 5WL4h78QTfFAfCbG (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 19 Jan 2020 11:11:00 -0500 (EST) Received: from simark.lan (unknown [192.222.164.54]) by smtp.ebox.ca (Postfix) with ESMTP id E7076441B21; Sun, 19 Jan 2020 11:10:59 -0500 (EST) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH] gdb/linux-fork: simplify one_fork_p Date: Sun, 19 Jan 2020 11:10:58 -0500 Message-Id: <20200119161058.864-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 X-IsSubscribed: yes Unless I'm missing something, this function is a complicated way of saying "fork_list.size () == 1". gdb/ChangeLog: * linux-fork.c (one_fork_p): Simplify. --- gdb/linux-fork.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c index 284f1985d0dc..357188685d07 100644 --- a/gdb/linux-fork.c +++ b/gdb/linux-fork.c @@ -110,8 +110,7 @@ find_last_fork (void) static bool one_fork_p () { - return (!fork_list.empty () - && &fork_list.front () == &fork_list.back ()); + return fork_list.size () == 1; } /* Add a new fork to the internal fork list. */