QFileSystemEntry: Replace manual seek in string with lastIndexOf()
Change-Id: Icf45795a962baa7102c02293cb7ce1781b8f2f56 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
79eef021cb
commit
a3617296f4
|
|
@ -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('/'));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue