diff options
author | suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> | 2011-08-12 20:22:30 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-09-12 16:03:47 +0200 |
commit | 5dd78ba08f31f9aa3c13d4e05ad4478033f7f4e8 (patch) | |
tree | 205d85f7806cbb2495ef3d4a5d043d4ec83f1ef3 /src/corelib/io/qdir.cpp | |
parent | 7b42532100c27280b6ea0658276511d7419742d4 (diff) |
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>
(cherry picked from commit 81f0c44f6a4fd4cfa41af5d5b292008185bf3981)
Conflicts:
src/qt3support/itemviews/q3listbox.cpp
src/qt3support/sql/q3datatable.cpp
src/qt3support/text/q3richtext.cpp
src/scripttools/debugging/qscriptcompletiontask.cpp
src/scripttools/debugging/qscriptdebuggercodeview.cpp
Change-Id: Ie70590e77e69fbb9b2322c48c3963fd9cbba19e6
Reviewed-on: http://codereview.qt-project.org/4581
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'src/corelib/io/qdir.cpp')
-rw-r--r-- | src/corelib/io/qdir.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index d1c9be213b..41278f1b91 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -1970,7 +1970,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; @@ -1978,9 +1978,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) { |