Commit e71912b4 authored by Joerg Bornemann's avatar Joerg Bornemann

QbsProjectManager: Avoid allocations in string comparisons

Use case-insensitive comparisons instead of converting toLower() first.
Found by clazy.

Change-Id: I0d32b0ba7ccb5493d1c86d41044b09c8baed3dc8
Reviewed-by: Jake Petroules's avatarJake Petroules <jake.petroules@qt.io>
Reviewed-by: Christian Kandeler's avatarChristian Kandeler <christian.kandeler@qt.io>
parent 235f9be9
......@@ -341,12 +341,14 @@ QVariantMap DefaultPropertyProvider::autoGeneratedProperties(const ProjectExplor
canonicalName.chop(version.size());
if (!canonicalName.isEmpty() && !version.isEmpty()
&& sysrootAbs.startsWith(developerPath)) {
if (sysrootAbs.toLower().endsWith(QStringLiteral("/%1.sdk")
.arg(canonicalName + version)))
if (sysrootAbs.endsWith(QStringLiteral("/%1.sdk").arg(canonicalName + version),
Qt::CaseInsensitive)) {
data.insert(QLatin1String(XCODE_SDK), QString(canonicalName + version));
if (sysrootAbs.toLower().endsWith(QStringLiteral("/%1.sdk")
.arg(canonicalName)))
}
if (sysrootAbs.endsWith(QStringLiteral("/%1.sdk").arg(canonicalName),
Qt::CaseInsensitive)) {
data.insert(QLatin1String(XCODE_SDK), canonicalName);
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment