qt-interest@trolltech.com
[Top] [All Lists]

[Qt-interest] QString::isEmpty vs. comparing against an empty string

Subject: [Qt-interest] QString::isEmpty vs. comparing against an empty string
From: Bruce Cran
Date: Mon, 1 Mar 2010 19:08:25 +0000
Hi,

I was reading through the Address Book example at 
http://doc.qt.nokia.com/4.6/tutorials-addressbook-part2.html and the code that 
checks if the input is empty jumped out at me. Coming from a .NET background 
I'm all too familiar with the FxCop warning informing people to check if the 
string length is 0 instead of comparing against the empty string to improve 
performance.
I know it's only a minor optimization, but is using QString::isEmpty preferred 
in the Qt world?

-- 
Bruce Cran
_______________________________________________
Qt-interest mailing list
Qt-interest@xxxxxxxxxxxxx
http://lists.trolltech.com/mailman/listinfo/qt-interest

<Prev in Thread] Current Thread [Next in Thread>