From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) by sourceware.org (Postfix) with ESMTPS id 36A9A3858D3C for ; Tue, 17 May 2022 13:59:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 36A9A3858D3C Received: by mail-io1-xd34.google.com with SMTP id o190so19272335iof.10 for ; Tue, 17 May 2022 06:59:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=R/59stPsw4B2T0Sg8hsz+B2cOER5yKbbNWE96sFpsqg=; b=XcM4Ao+fsUVjXMsl1qO3+sQWmhp1pkhR+rm43a5jnGRyn1qrGAVDlYOqaMfrYEE/O+ 2s/Do5DS2ovTzSPbh5DrWlxAp+/6QIqUECpCijFI3lzi7wcg+tX78a7lpMOJ0KkqEM0W F3LkDUMQosixAA2hjKt6OgMATGNfOP20CeqQY+Hr+nj6v3k28cU+SUHDHpvHHcffDQAf Pg8AAu5Ah29LedcdgiuyCsCqG3abOZUEy2mdpXvCt9mBnKlaWZL7u63vePNsCAQRFu0m j80GvTN+tyH+lSVvxmAi6/LIIiotyIercUzTj3NS6xwCIHZ09qIpFY6qBESkq6zI2Kh6 sBuA== X-Gm-Message-State: AOAM532hZqwdXO9jvrYUrJNCYRUkqdS+X2dBV5fjzkROvvBtyU9c9LPQ CqTTWjS+zK0zhnuVMS3ym5ApHwZ7Hfpz2A== X-Google-Smtp-Source: ABdhPJxFNTI85HqZPrnXEN+lziCi8e0hiVLnV7jFa1JJIzdwGdfB75LV7/5zD82YdhSRR8LrBJT9tw== X-Received: by 2002:a05:6638:22c9:b0:32e:3afa:981b with SMTP id j9-20020a05663822c900b0032e3afa981bmr4728830jat.133.1652795969473; Tue, 17 May 2022 06:59:29 -0700 (PDT) Received: from murgatroyd (71-211-158-194.hlrn.qwest.net. [71.211.158.194]) by smtp.gmail.com with ESMTPSA id e9-20020a02a509000000b0032e43307dbasm1048736jam.55.2022.05.17.06.59.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 06:59:28 -0700 (PDT) From: Tom Tromey To: Lancelot SIX Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH] Finalize each cooked index separately References: <20220516184614.1171732-1-tromey@adacore.com> <20220517084248.j6w4du4pugvtzvyp@ubuntu.lan> X-Attribution: Tom Date: Tue, 17 May 2022 07:59:27 -0600 In-Reply-To: <20220517084248.j6w4du4pugvtzvyp@ubuntu.lan> (Lancelot SIX's message of "Tue, 17 May 2022 08:43:00 +0000") Message-ID: <87a6bgdzuo.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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-List-Received-Date: Tue, 17 May 2022 13:59:31 -0000 >>>>> "Lancelot" =3D=3D Lancelot SIX writes: Lancelot> I have a couple of comments/suggestions inlined in the patch belo= w. Thank you for the review. >> + std::vector result_range; Lancelot> Since the result_range's expected size is already known, it is po= ssible Lancelot> to pre-allocate the associated storage with Lancelot> result_range.reserve (m_vector.size); I've made this change in both spots. >> + /* Create a new range_chain, transferring in a vector of >> + sub-ranges. */ >> + range_chain (std::vector &&ranges) >> + : m_ranges (ranges) Lancelot> Did you forget the std::move (ranges) here? Otherwise I=E2=80=AFt= hink m_ranges Lancelot> is initialized using a copy ctor instead of the intended move cto= r. Yes, oops. Lancelot> template Lancelot> range_chain (Ranges &&ranges) Lancelot> : m_ranges (std::forward (ranges)) Lancelot> { } I did this too. Lancelot> I was wondering why the begin () and end () are not const. Turns= out Lancelot> that they could become const if the following adjustments are don= e to Lancelot> the iterator class: I made these const and updated the iterator. Tom