diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-10-10 10:34:46 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-10-11 12:29:44 +0000 |
commit | a6ddae873bbe4c3cc68949f5a2758b5458422e7c (patch) | |
tree | 0fdb4e3d1e95ce512372d19105b57e2df99038eb /src | |
parent | 48663eafd3521eadcd6094178afa75909dc3c09e (diff) |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/io/qdir.cpp | 2 | ||||
-rw-r--r-- | src/corelib/tools/qstring.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index e1d9858a66..4d2b36632f 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -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) diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index e3a3cc79c6..ea220ed557 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -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) { |