[Development] QStringLiteral vs QLatin1String , foreach vs for range

Gunnar Roth gunnar.roth at gmx.de
Sun Jan 17 22:22:39 CET 2016

Hi, thanks for answering, but

> Am 17.01.2016 um 20:36 schrieb Thiago Macieira <thiago.macieira at intel.com>:
> On Sunday 17 January 2016 19:13:44 Gunnar Roth wrote:
>> Hi,
>> I saw quite some changes like https://codereview.qt-project.org/#/c/145961/
>> <https://codereview.qt-project.org/#/c/145961/>  Replace QStringLiteral
>> with QLatin1String in QFileSelector. I also read about the problem of
>> QStringLiteral concerning plugins, but what is the idea behind these
>> changes ?
> QLatin1String is more efficient if you're calling a method that has a 
> QLatin1String overload, like most methods in QString itself.
why is QLatin1String more efficient than QLiteralString in this case? both strings  being uft16 seems to be faster for, you could use size_t chunks for comparison for example.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20160117/85175372/attachment.html>

More information about the Development mailing list