public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: Re: [PATCH] gdb: remove unnecessary call to std::string constructor
Date: Fri, 12 May 2023 12:44:15 -0600	[thread overview]
Message-ID: <87jzxd2xvk.fsf@tromey.com> (raw)
In-Reply-To: <20230511173351.41358-1-simon.marchi@efficios.com> (Simon Marchi via Gdb-patches's message of "Thu, 11 May 2023 13:33:51 -0400")

>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

Simon> I spotted this explicit call to std::string, which creates an
Simon> unnecessary temporary extra std::string, while calling emplace_back.
Simon> I'm not sure if it has any impact in an optimized build, maybe the
Simon> compiler elides it.  But still, it's unnecessary.

It probably just moves the new string, but I agree it's better with your patch.

Tom

  reply	other threads:[~2023-05-12 18:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-11 17:33 Simon Marchi
2023-05-12 18:44 ` Tom Tromey [this message]
2023-05-12 18:50   ` Simon Marchi

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=87jzxd2xvk.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@efficios.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).