summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfilesystementry.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2015-01-10 19:48:43 +0200
committerOrgad Shaneh <orgads@gmail.com>2015-01-11 05:08:53 +0100
commita3617296f46ffaf3490050fde1695fafedf7a475 (patch)
tree097dd0d6324ca00ee7ca73d577a00d90538aa2a7 /src/corelib/io/qfilesystementry.cpp
parent79eef021cbd8d9789d3b2a63cca2b04c84a3ae05 (diff)
QFileSystemEntry: Replace manual seek in string with lastIndexOf()
Change-Id: Icf45795a962baa7102c02293cb7ce1781b8f2f56 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qfilesystementry.cpp')
-rw-r--r--src/corelib/io/qfilesystementry.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/corelib/io/qfilesystementry.cpp b/src/corelib/io/qfilesystementry.cpp
index 8e48dd1630..69c0e08763 100644
--- a/src/corelib/io/qfilesystementry.cpp
+++ b/src/corelib/io/qfilesystementry.cpp
@@ -315,13 +315,7 @@ void QFileSystemEntry::findLastSeparator() const
{
if (m_lastSeparator == -2) {
resolveFilePath();
- m_lastSeparator = -1;
- for (int i = m_filePath.size() - 1; i >= 0; --i) {
- if (m_filePath[i].unicode() == '/') {
- m_lastSeparator = i;
- break;
- }
- }
+ m_lastSeparator = m_filePath.lastIndexOf(QLatin1Char('/'));
}
}