aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlessandro Portale <alessandro.portale@qt.io>2020-07-26 07:55:41 +0200
committerAlessandro Portale <alessandro.portale@qt.io>2020-07-26 07:55:41 +0200
commit4cbd3a7404feb8c742445277ca7ed8a0edfc02cd (patch)
tree17c5b94bba735c0182f219ca927f940d6fcba7b6
parentea3ebedf4b5a6dfb605ebeeb12d1c5e9ff53f44f (diff)
Using & to prevent copy in for loop
-rw-r--r--main.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/main.cpp b/main.cpp
index c306583..b691094 100644
--- a/main.cpp
+++ b/main.cpp
@@ -198,7 +198,7 @@ void parseQmlprojectFile(const QString &fileName, QString *mainFile, QStringList
const QRegularExpression importPathsRegExp("importPaths:\\s*\\[\\s*(.*)\\s*\\]");
const QRegularExpressionMatch importPathsMatch = importPathsRegExp.match(text);
if (importPathsMatch.hasMatch()) {
- for (const QString path : importPathsMatch.captured(1).split(",")) {
+ for (const QString &path : importPathsMatch.captured(1).split(",")) {
QString cleanedPath = path.trimmed();
cleanedPath = basePath + cleanedPath.mid(1, cleanedPath.length() - 2);
if (QFileInfo::exists(cleanedPath)) {