[ki18n] src: small qstring optimizations

Nick Shaforostoff shafff at ukr.net
Sun Jan 25 14:28:44 UTC 2015


> On Wednesday 21 January 2015 21:32:07 Nick Shaforostoff wrote:
> > +static const QString SUBSTITUTE_ME=QStringLiteral("%1");
> 
> I'm not sure that adding global static (non-POD) objects in libraries is a 
> good idea.
> We've had many problems with that in the past (see below for details), and 
> they slow down application startup by having to create all these global 
> objects even if they are never going to be used.
> 
> PS: nowadays most commits to KDE Frameworks go via reviewboard so they can be 
> reviewed prior to being pushed.

understood. i'll create a review request for fixing this.
would a static variable inside a function be enough?
or one should just have separate non-static qstrings in each method?


More information about the Kde-frameworks-devel mailing list