Review Request 113216: some little performance improvement for network kio

Milian Wolff mail at milianw.de
Sun Oct 13 18:04:00 BST 2013


-----------------------------------------------------------
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
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20131013/baabcf4a/attachment.htm>


More information about the kde-core-devel mailing list