diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2020-07-26 07:55:41 +0200 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2020-07-26 07:55:41 +0200 |
commit | 4cbd3a7404feb8c742445277ca7ed8a0edfc02cd (patch) | |
tree | 17c5b94bba735c0182f219ca927f940d6fcba7b6 | |
parent | ea3ebedf4b5a6dfb605ebeeb12d1c5e9ff53f44f (diff) |
Using & to prevent copy in for loop
-rw-r--r-- | main.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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)) { |