diff options
author | Ritt Konstantin <ritt.ks@gmail.com> | 2010-01-29 12:12:44 (GMT) |
---|---|---|
committer | João Abecasis <joao@trolltech.com> | 2010-01-29 12:12:44 (GMT) |
commit | 6d8ea540bd123270f0010eb5fa5e68a510ca89e7 (patch) | |
tree | 67ac34057001a1baa3de1c026dce1a9491586d91 /src | |
parent | 6d2288d4b8d6ffe7eb7cef9a0677be2ad3f45341 (diff) | |
download | Qt-6d8ea540bd123270f0010eb5fa5e68a510ca89e7.zip Qt-6d8ea540bd123270f0010eb5fa5e68a510ca89e7.tar.gz Qt-6d8ea540bd123270f0010eb5fa5e68a510ca89e7.tar.bz2 |
nano-optimizations
Merge-request: 445
Reviewed-by: João Abecasis <joao@trolltech.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/io/qdir.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index 0b6ad08..250e5e5 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -1692,8 +1692,7 @@ bool QDir::remove(const QString &fileName) qWarning("QDir::remove: Empty or null file name"); return false; } - QString p = filePath(fileName); - return QFile::remove(p); + return QFile::remove(filePath(fileName)); } /*! @@ -1740,8 +1739,7 @@ bool QDir::exists(const QString &name) const qWarning("QDir::exists: Empty or null file name"); return false; } - QString tmp = filePath(name); - return QFile::exists(tmp); + return QFile::exists(filePath(name)); } /*! @@ -1984,7 +1982,7 @@ QString QDir::rootPath() */ bool QDir::match(const QStringList &filters, const QString &fileName) { - for (QStringList::ConstIterator sit = filters.begin(); sit != filters.end(); ++sit) { + for (QStringList::ConstIterator sit = filters.constBegin(); sit != filters.constEnd(); ++sit) { QRegExp rx(*sit, Qt::CaseInsensitive, QRegExp::Wildcard); if (rx.exactMatch(fileName)) return true; @@ -2126,12 +2124,8 @@ QString QDir::cleanPath(const QString &path) out[iwrite++] = p[i]; used++; } - QString ret; - if(used == len) - ret = name; - else - ret = QString(out, used); + QString ret = (used == len ? name : QString(out, used)); // Strip away last slash except for root directories if (ret.length() > 1 && ret.endsWith(QLatin1Char('/'))) { #ifdef Q_OS_WIN |