----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/113216/#review41651 -----------------------------------------------------------
Imo it's wrong to return const& in the first place. You can bind const& also to temporaries, see e.g. http://herbsutter.com/2008/01/01/gotw-88-a-candidate-for-the-most-important-const/ Anyhow, this may marginally improve performance (if the compiler is really not smart enough to do that automatically), as you'll save the atomic incr/decr related to the internal refcounting of QString. Considering that someone has done the work here now, imo it's OK to commit it. Still, this is a micro-optimization. If the maintainer of this code feels against it, I could also understand that. - Milian Wolff On Oct. 12, 2013, 12:06 p.m., Jaime Torres Amate wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://git.reviewboard.kde.org/r/113216/ > ----------------------------------------------------------- > > (Updated Oct. 12, 2013, 12:06 p.m.) > > > Review request for KDE Runtime. > > > Repository: kde-runtime > > > Description > ------- > > A new check by cppcheck (avoid to call the copy constructor). > networkUri.serviceName() and networkUri.serviceType() and > networkUri.hostAddress() return const QString&. > > > Diffs > ----- > > kioslave/network/ioslave/networkslave.cpp a548f1a > > Diff: http://git.reviewboard.kde.org/r/113216/diff/ > > > Testing > ------- > > > Thanks, > > Jaime Torres Amate > >