FilePath: Optimize string compare in setParts

Change-Id: Ibc390ee943ed41dfef30fbbd07e2e681d82379ba
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Orgad Shaneh
2023-04-03 23:20:22 +03:00
committed by Orgad Shaneh
parent 0edf909b45
commit 9956740905

View File

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