Review Request 125106: Minor optimizations

Matthew Dawson matthew at mjdsystems.ca
Sat Oct 3 00:28:43 UTC 2015


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125106/#review86264
-----------------------------------------------------------


Sorry, +1 from me generally, but one question about QLatin1String vs QStringLiteral.  My research suggests some of these should be QStringLiteral, but please let me know if I'm mistaken.


src/core/kdesktopfile.cpp (line 307)
<https://git.reviewboard.kde.org/r/125106/#comment59445>

    Since this gets converted to a QString immediately, should this not be a QStringLiteral?  There doesn't seem to be an override for the + operator for QLatin1String, so it has to convert to UTF-16 anways.  There are a bunch of such cases below as well.
    
    I double checked against QStringBuilder, and I don't see it helping either.  It still does the conversion anyways.


- Matthew Dawson


On Sept. 11, 2015, 7:56 p.m., Albert Astals Cid wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/125106/
> -----------------------------------------------------------
> 
> (Updated Sept. 11, 2015, 7:56 p.m.)
> 
> 
> Review request for KDE Frameworks and Matthew Dawson.
> 
> 
> Repository: kconfig
> 
> 
> Description
> -------
> 
> Ran the clazy tool (http://www.kdab.com/use-static-analysis-improve-performance/)
> 
> Mostly QStringLiteral/QLatin1String additions
> A few const & additions to non public methods
> 
> 
> Diffs
> -----
> 
>   src/kconfig_compiler/kconfig_compiler.cpp 5c515f4 
>   src/kconf_update/kconfigutils.cpp 0fec63a 
>   src/kconf_update/kconf_update.cpp a1c98cb 
>   src/gui/kwindowconfig.cpp a32c6cc 
>   src/core/kdesktopfile.cpp 49f37c3 
>   src/core/ksharedconfig.cpp e059b87 
>   src/core/kconfigini.cpp 856b7b7 
>   src/core/kcoreconfigskeleton_p.h d098ef6 
>   src/core/kauthorized.cpp 4280524 
>   src/core/kconfig.cpp 4be9e6d 
>   src/core/kconfigbackend.cpp 67bdefa 
> 
> Diff: https://git.reviewboard.kde.org/r/125106/diff/
> 
> 
> Testing
> -------
> 
> Compiles, test pass
> 
> 
> Thanks,
> 
> Albert Astals Cid
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20151003/9ad3c4f7/attachment.html>


More information about the Kde-frameworks-devel mailing list