From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 54434 invoked by alias); 19 Jan 2020 16:57:06 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 54426 invoked by uid 89); 19 Jan 2020 16:57:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.9 required=5.0 tests=AWL,BAYES_00,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_PASS,USER_IN_DEF_SPF_WL autolearn=ham version=3.3.1 spammy=whoever, HX-HELO:sk:mail-ot, HX-Spam-Relays-External:209.85.210.67, H*RU:209.85.210.67 X-HELO: mail-ot1-f67.google.com Received: from mail-ot1-f67.google.com (HELO mail-ot1-f67.google.com) (209.85.210.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 19 Jan 2020 16:57:05 +0000 Received: by mail-ot1-f67.google.com with SMTP id 59so26632474otp.12 for ; Sun, 19 Jan 2020 08:57:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Mu7J6wvhdU0eX0Jngn+7vs8jAGdFq0nVJl6xaVLXvDs=; b=cvcaCe9z/ws8WZ8kHx3Hvd1WPg5HoyZJF9KV3j9xyVwe/n0gMBho+OgFNWjDSYUYdd nQAETFAlD453cPWSKddCPuMswj8WLqbje9+xRmI6oWL5T4zo5lKT6lNAfCx+EiBN9K5V M4DvfMUOVpDJnrPdJMXYgVo/z982uFIPRgaOVl2TEJVqQiS8Vp5D7gYVGvFj1keuTTBE Zi/wy5L1Q9FS4mKeLjscodN5JruyvBuMhVI0gpyeaR4HoNbAB4O/ZmMuU9X4vLEZUxNL uxSBVQFVs4wyGG8Vw9x0SQLsrjQ+q2frKNtxpqsdrx5wfl2feajXE4/tbfliC/bSxuov IwvQ== MIME-Version: 1.0 References: <20200119161058.864-1-simon.marchi@polymtl.ca> <770454ed-d5b0-4fce-0bf2-a6952f276959@polymtl.ca> In-Reply-To: <770454ed-d5b0-4fce-0bf2-a6952f276959@polymtl.ca> From: "Christian Biesinger via gdb-patches" Reply-To: Christian Biesinger Date: Sun, 19 Jan 2020 17:01:00 -0000 Message-ID: Subject: Re: [PATCH] gdb/linux-fork: simplify one_fork_p To: Simon Marchi Cc: gdb-patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2020-01/txt/msg00588.txt.bz2 On Sun, Jan 19, 2020 at 11:53 AM Simon Marchi wrote: > > On 2020-01-19 11:41 a.m., Christian Biesinger wrote: > > On Sun, Jan 19, 2020 at 11:11 AM Simon Marchi wrote: > >> > >> Unless I'm missing something, this function is a complicated way of > >> saying "fork_list.size () == 1". > > > > Before C++11, size() wasn't guaranteed to run in constant time, so I > > assume the code was written to handle that. But GDB uses C++11, so > > this change seems fine. > > https://en.cppreference.com/w/cpp/container/list/size > > Ahh, good point. Although by the time that change was made, we were already > using C++11. I don't remember if we had a C++ < 11 phase, but if we did it > was very short. > > Thanks for looking at it, I'll push it now. Ah. it's also possible that whoever wrote the code just assumed that size() would run in linear time, of course. Christian