From: Tom Tromey <tromey@adacore.com>
To: Lancelot SIX <lsix@lancelotsix.com>
Cc: Tom Tromey <tromey@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Finalize each cooked index separately
Date: Tue, 17 May 2022 07:59:27 -0600 [thread overview]
Message-ID: <87a6bgdzuo.fsf@tromey.com> (raw)
In-Reply-To: <20220517084248.j6w4du4pugvtzvyp@ubuntu.lan> (Lancelot SIX's message of "Tue, 17 May 2022 08:43:00 +0000")
>>>>> "Lancelot" == Lancelot SIX <lsix@lancelotsix.com> writes:
Lancelot> I have a couple of comments/suggestions inlined in the patch below.
Thank you for the review.
>> + std::vector<cooked_index::range> result_range;
Lancelot> Since the result_range's expected size is already known, it is possible
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<Range> &&ranges)
>> + : m_ranges (ranges)
Lancelot> Did you forget the std::move (ranges) here? Otherwise I think m_ranges
Lancelot> is initialized using a copy ctor instead of the intended move ctor.
Yes, oops.
Lancelot> template<typename Ranges>
Lancelot> range_chain (Ranges &&ranges)
Lancelot> : m_ranges (std::forward<Ranges> (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 done to
Lancelot> the iterator class:
I made these const and updated the iterator.
Tom
next prev parent reply other threads:[~2022-05-17 13:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-16 18:46 Tom Tromey
2022-05-17 8:43 ` Lancelot SIX
2022-05-17 13:59 ` Tom Tromey [this message]
2022-05-26 13:48 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a6bgdzuo.fsf@tromey.com \
--to=tromey@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=lsix@lancelotsix.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).