forked from qt-creator/qt-creator
FilePath: Optimize string compare in setParts
Change-Id: Ibc390ee943ed41dfef30fbbd07e2e681d82379ba Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
0edf909b45
commit
9956740905
@@ -438,7 +438,7 @@ void FilePath::setParts(const QStringView scheme, const QStringView host, QStrin
|
|||||||
{
|
{
|
||||||
QTC_CHECK(!scheme.contains('/'));
|
QTC_CHECK(!scheme.contains('/'));
|
||||||
|
|
||||||
if (path.startsWith(u"/./"))
|
if (path.length() >= 3 && path[0] == '/' && path[1] == '.' && path[2] == '/')
|
||||||
path = path.mid(3);
|
path = path.mid(3);
|
||||||
|
|
||||||
m_data = path.toString() + scheme.toString() + host.toString();
|
m_data = path.toString() + scheme.toString() + host.toString();
|
||||||
|
Reference in New Issue
Block a user