diff --git a/tests/auto/tools/macdeployqt/tst_macdeployqt.cpp b/tests/auto/tools/macdeployqt/tst_macdeployqt.cpp index 3953452bf84..3125d7076e2 100644 --- a/tests/auto/tools/macdeployqt/tst_macdeployqt.cpp +++ b/tests/auto/tools/macdeployqt/tst_macdeployqt.cpp @@ -200,10 +200,10 @@ void runVerifyDeployment(const QString &name) const QString qtPath = QLibraryInfo::path(QLibraryInfo::PrefixPath); // Let assume Qt is not installed in system for (const QString &part : parts) { - part = part.trimmed(); - if (part.isEmpty()) + const auto trimmed = part.trimmed(); + if (trimmed.isEmpty()) continue; - QVERIFY(!part.startsWith(qtPath)); + QVERIFY(!trimmed.startsWith(qtPath)); } }