QtCore: Don't compare QChars to literal 0s

This is prone to ambiguities, even though we currently don't run
into them.

Use QChar::isNull() instead.

Change-Id: I71843878b3f4f8a5deae2ef57a6f6628461be216
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
Marc Mutz 2015-10-10 10:34:46 +02:00
parent 48663eafd3
commit a6ddae873b
2 changed files with 2 additions and 2 deletions

View File

@ -138,7 +138,7 @@ inline QChar QDirPrivate::getFilterSepChar(const QString &nameFilter)
// static
inline QStringList QDirPrivate::splitFilters(const QString &nameFilter, QChar sep)
{
if (sep == 0)
if (sep.isNull())
sep = getFilterSepChar(nameFilter);
QStringList ret = nameFilter.split(sep);
for (int i = 0; i < ret.count(); ++i)

View File

@ -1509,7 +1509,7 @@ QString::QString(const QChar *unicode, int size)
} else {
if (size < 0) {
size = 0;
while (unicode[size] != 0)
while (!unicode[size].isNull())
++size;
}
if (!size) {