summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorsuzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>2011-08-12 18:22:30 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2011-08-18 09:02:53 (GMT)
commit81f0c44f6a4fd4cfa41af5d5b292008185bf3981 (patch)
tree376f0029464338d17addb55ee74b4f387bf2852b /src/corelib/io
parentd9b8c530fceced62ab620307f399c3e985640282 (diff)
downloadQt-81f0c44f6a4fd4cfa41af5d5b292008185bf3981.zip
Qt-81f0c44f6a4fd4cfa41af5d5b292008185bf3981.tar.gz
Qt-81f0c44f6a4fd4cfa41af5d5b292008185bf3981.tar.bz2
Replace 'i < len-1 && func(i+1)' by 'i+1 < len && func(i+1)'
Merge-request: 1299 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qdir.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index f9196e0..3db3dfc 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -2004,7 +2004,7 @@ QString QDir::cleanPath(const QString &path)
const QChar *p = name.unicode();
for (int i = 0, last = -1, iwrite = 0; i < len; ++i) {
if (p[i] == QLatin1Char('/')) {
- while (i < len-1 && p[i+1] == QLatin1Char('/')) {
+ while (i+1 < len && p[i+1] == QLatin1Char('/')) {
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) //allow unc paths
if (!i)
break;
@@ -2012,9 +2012,9 @@ QString QDir::cleanPath(const QString &path)
i++;
}
bool eaten = false;
- if (i < len - 1 && p[i+1] == QLatin1Char('.')) {
+ if (i+1 < len && p[i+1] == QLatin1Char('.')) {
int dotcount = 1;
- if (i < len - 2 && p[i+2] == QLatin1Char('.'))
+ if (i+2 < len && p[i+2] == QLatin1Char('.'))
dotcount++;
if (i == len - dotcount - 1) {
if (dotcount == 1) {