QFileSystemEntry: Replace manual seek in string with lastIndexOf()

Change-Id: Icf45795a962baa7102c02293cb7ce1781b8f2f56
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Orgad Shaneh 2015-01-10 19:48:43 +02:00 committed by Orgad Shaneh
parent 79eef021cb
commit a3617296f4
1 changed files with 1 additions and 7 deletions

View File

@ -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('/'));
}
}