From a3617296f46ffaf3490050fde1695fafedf7a475 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Sat, 10 Jan 2015 19:48:43 +0200 Subject: QFileSystemEntry: Replace manual seek in string with lastIndexOf() Change-Id: Icf45795a962baa7102c02293cb7ce1781b8f2f56 Reviewed-by: Thiago Macieira --- src/corelib/io/qfilesystementry.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/corelib') 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('/')); } } -- cgit v1.2.3