Expensive QString = ""

Alexander Kellett kde-optimize@mail.kde.org
Wed, 12 Mar 2003 01:18:18 +0100


On Wed, Mar 12, 2003 at 01:02:25AM +0100, Andr? W?bbeking wrote:
> I don't know, if QString = "" appears frequently in time critical code (KHtml, 
> KDE start up, KConfig, ...), but if you really need an empty QString the 
> better solution would be to use a static const QString like QString::null.

just fyi,
(QString::null).isNull() != QString("").isNull())
therefore, they can't just be randomly switched over.
in fact i kind of dislike the use of a null string
in place of an formally empty string, its just not 
explicit enough for my liking.

Alex