From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id pvN4GbTysGgFzw4AWB0awg (envelope-from ) for ; Thu, 28 Aug 2025 20:22:12 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=E0PvhwnJ; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 55FA91E023; Thu, 28 Aug 2025 20:22:12 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_LOW,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=no autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id AC23C1E023 for ; Thu, 28 Aug 2025 20:22:11 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4C8B73858C74 for ; Fri, 29 Aug 2025 00:22:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4C8B73858C74 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=E0PvhwnJ Received: from omta34.uswest2.a.cloudfilter.net (omta34.uswest2.a.cloudfilter.net [35.89.44.33]) by sourceware.org (Postfix) with ESMTPS id AEDB43858C74 for ; Fri, 29 Aug 2025 00:20:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AEDB43858C74 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AEDB43858C74 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1756426807; cv=none; b=tbFLDewL2n0RlV2+U5svlVUkRZZUAG7p26lu7L1QUQlFxkJDw7jvT04uwnWajcadqll4s/+RmaZe1+VoaRRYUGszXZwW8zzzn9Ql6p/eSQ2RQlsl68pAyp6YPRH+ZbeWtoxzm35uCFGaEFKFpeM7PF9I8Lo+oMXhOncc99FHgnM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1756426807; c=relaxed/simple; bh=MXp3QAGNc9+8XYiQMk/9DsDeCyC24VqriwwMBuve0TM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ZNR31h7ZtdGn9GHU98Jmlp9hEb0PIFxPvU9XTxTR7qFm0ixtwJ99D+isUDZBZSCpAssmA5+lPFdATdFg7MsUDZS/FL+Z7QjxKVXg9RYRynqbMaTR+uIQOYp9AoALB0WwM866tA5jHeMMwz603nVUd76PGKNfFCRr9wrGiNDpmBU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AEDB43858C74 Received: from eig-obgw-5003b.ext.cloudfilter.net ([10.0.29.155]) by cmsmtp with ESMTPS id rkC3uvBKTdalurmqcuTKBa; Fri, 29 Aug 2025 00:20:06 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id rmqbu2BAbE5uDrmqcuXPwm; Fri, 29 Aug 2025 00:20:06 +0000 X-Authority-Analysis: v=2.4 cv=dtDbC0g4 c=1 sm=1 tr=0 ts=68b0f236 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=2OwXVqhp2XgA:10 a=ItBw4LHWJt0A:10 a=Twlkf-z8AAAA:8 a=dzWzf_mpAAAA:8 a=4nA-XAGSkQi9NUuFTZgA:9 a=r0HvZpjT5i0A:10 a=-74SuR6ZdpOK_LpdRCUo:22 a=b4DR9a7p2ZdsqdHBznES:22 a=VS4QxaUSPT0UtbFnIvSC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=QY7ovi/+VkCoxbGCaygMrTf0jp1C2dOAR1ob6CFMmR8=; b=E0PvhwnJGshTxRIsL0Se8N0iqf m3+lD1ThreDzxsYA0pqKmObGQ6TI3TZ4axdOYpT2DQeK0PIwPXACm30Pn67r6QaDLTAIQ4Ji+6fv1 hreTRyOy9L/hOURtg3/1aAqAV; Received: from 97-122-110-68.hlrn.qwest.net ([97.122.110.68]:45122 helo=prentzel) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1urmqb-00000002xLH-1BxK; Thu, 28 Aug 2025 18:20:05 -0600 From: Tom Tromey To: Simon Marchi Cc: Tom de Vries , Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH v2 2/5] [gdb] Make addrmap_mutable::insert_empty return bool In-Reply-To: (Simon Marchi's message of "Sat, 23 Aug 2025 13:53:30 -0400") References: <20250821133114.24091-1-tdevries@suse.de> <20250821133114.24091-3-tdevries@suse.de> <87a53rkx5v.fsf@tromey.com> X-Attribution: Tom Date: Thu, 28 Aug 2025 18:20:03 -0600 Message-ID: <87frdbj7ws.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.110.68 X-Source-L: No X-Exim-ID: 1urmqb-00000002xLH-1BxK X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-110-68.hlrn.qwest.net (prentzel) [97.122.110.68]:45122 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfMTbPQJLgcIt6iBUx1KqfIJGcfVmMELsMB9/kTQ1HJedQ99sVolHL0lt1RLUSWCG5VhIt+XRH7rFaAHVbnh8yiEtiF4Xa1RAXwR4W0Ed2Rdfo/AQn/nG Rzxb7o8kUBk5fh3jj79NScHJq/YwDMUUuGoLdsT3qI5WIUm88zy79Y4fnoKYtHGf1bM2B2VrTckuVOqtsSl6POWdrL0YXJCdzDw= X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org >>>>> "Simon" == Simon Marchi writes: Tom> + if (addrmap_node_value (n)) Tom> + { Tom> + /* Already mapped. */ Tom> + full_range = false; Tom> + continue; Tom> + } Tom> + Tom> + addrmap_node_set_value (n, obj); >> FWIW, I still think that they way I wrote is is much better. My >> opinion is based on this coding standard rule ( >> https://llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code >> ). I don't think we should use LLVM's coding standards. Particularly so now that I've worked on LLVM this last year. Simon> I also like early returns and early continue in loops. It tells me: you Simon> don't need to think about that case for the rest of the function loop. In this particular case the two branches are single lines. Using a continue here seems more confusing for that reason -- it's just more to process here. I get it for longer loops, at least situationally. Tom