Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Joel Brobecker <brobecker@adacore.com>,
	Ulrich Weigand <uweigand@de.ibm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC][08/19] Target FP: Use target format throughout expression parsing
Date: Mon, 09 Oct 2017 21:14:00 -0000	[thread overview]
Message-ID: <e96ca6af-7d12-a820-080f-215a2bb90b3f@simark.ca> (raw)
In-Reply-To: <20171009181215.tx5pxfnpuxt7ikcy@adacore.com>

On 2017-10-09 02:12 PM, Joel Brobecker wrote:
> One C++ thing I did notice but forgot to report...
> 
>> +floatformat_from_string (const struct floatformat *fmt, gdb_byte *out,
>> +			 std::string in)
> 
> Again, to be double-checked, but I think you want to pass the argument
> by reference in this case. Otherwise, you may end up having an overhead
> with might not be necessary due to the creation of a copy of the string
> being passed as argument here.
> 

Indeed, it's good practice to pass constant strings (or other objects) as
const references (const std::string &in).

Simon


  reply	other threads:[~2017-10-09 21:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-05 18:21 Ulrich Weigand
2017-10-09 16:07 ` Joel Brobecker
2017-10-09 16:59   ` Ulrich Weigand
2017-10-09 18:12 ` Joel Brobecker
2017-10-09 21:14   ` Simon Marchi [this message]
2017-10-25 13:35     ` [pushed] " Ulrich Weigand
2017-11-03 12:33       ` Yao Qi
2017-11-03 13:45         ` Ulrich Weigand
2017-11-03 15:00           ` Yao Qi
2017-11-03 15:11             ` Ulrich Weigand

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=e96ca6af-7d12-a820-080f-215a2bb90b3f@simark.ca \
    --to=simark@simark.ca \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=uweigand@de.ibm.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