On Wed, Apr 04, 2012 at 04:02:38PM +0200, Peter Hatina wrote:
> Hi,
> 
> On 04/03/2012 04:38 PM, Christophe Fergeau wrote:
> > All callers were using std::string::c_str(), better to move this
> > call to SendStr instead of doing it everywhere.
> > ---
> >  SpiceXPI/src/plugin/plugin.cpp |   28 ++++++++++++++--------------
> >  SpiceXPI/src/plugin/plugin.h   |    2 +-
> >  2 files changed, 15 insertions(+), 15 deletions(-)
> > 
> > diff --git a/SpiceXPI/src/plugin/plugin.cpp b/SpiceXPI/src/plugin/plugin.cpp
> > index 04d272b..008688a 100644
> > --- a/SpiceXPI/src/plugin/plugin.cpp
> > +++ b/SpiceXPI/src/plugin/plugin.cpp
> > @@ -570,16 +570,16 @@ void nsPluginInstance::SendBool(uint32_t id, bool 
> > value)
> >      WriteToPipe(&msg, sizeof(msg));
> >  }
> >  
> > -void nsPluginInstance::SendStr(uint32_t id, const char *str)
> > +void nsPluginInstance::SendStr(uint32_t id, std::string str)
> 
> Maybe, you could have used:
> 
> void nsPluginInstance::SendStr(uint32_t id, std::string &str)
> 
> To avoid unnecessary copying. Just a footnote :)

I nearly made the opposite footnote in one of your patches :) I remember
reading somewhere that copying a std::string is cheap enough that we don't
really need to care about passing it by reference. Since I cannot find
where I read that, I'll have to agree with you :) Hope you don't mind if I
leave things this way though? I've pushed the patch this morning
unfortunately...

Christophe

Attachment: pgpyk1AAjhV11.pgp
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to