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:
parent
48663eafd3
commit
a6ddae873b
@ -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)
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user