aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/generator/makefilegenerator/makefilegenerator.cpp
diff options
context:
space:
mode:
authorIvan Komissarov <abbapoh@gmail.com>2020-05-14 18:49:05 +0200
committerIvan Komissarov <ABBAPOH@gmail.com>2020-05-25 08:59:04 +0000
commitff61ba1702644bd558ba5d65821b885d39a21e1d (patch)
tree3938f243e9126bf1163cce06264ca46b02132ebf /src/plugins/generator/makefilegenerator/makefilegenerator.cpp
parent6bba36e5e76820409bd3afad5da6883a79f79904 (diff)
ProjectData: return const values/references
Qbs does not care that much about binary compatilibity (because of qbs session) and thus is is preferable to return members by const-ref (saving 2 atomic operations and preventing from accidental detaches). In case when method needs to compute some value instead of returning member directly, the function signature can be changed. Change-Id: I4e8d228761a990d274e77652c94adf9f43a758f1 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/generator/makefilegenerator/makefilegenerator.cpp')
-rw-r--r--src/plugins/generator/makefilegenerator/makefilegenerator.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/generator/makefilegenerator/makefilegenerator.cpp b/src/plugins/generator/makefilegenerator/makefilegenerator.cpp
index 24aff5a33..a158df0ac 100644
--- a/src/plugins/generator/makefilegenerator/makefilegenerator.cpp
+++ b/src/plugins/generator/makefilegenerator/makefilegenerator.cpp
@@ -182,7 +182,7 @@ void qbs::MakefileGenerator::generate()
"is not supported by this generator.").arg(srcDir));
}
stream << "SRCDIR = " << QDir::toNativeSeparators(srcDir) << '\n';
- const QString buildDir = projectData.buildDirectory();
+ const QString &buildDir = projectData.buildDirectory();
if (buildDir.contains(QLatin1Char(' '))) {
throw ErrorInfo(Tr::tr("The build directory '%1' contains space characters, which"
"is not supported by this generator.").arg(buildDir));
@@ -293,7 +293,7 @@ void qbs::MakefileGenerator::generate()
stream << "install-" << productTarget << ": " << productTarget << '\n';
Set<QString> createdDirs;
const auto installableArtifacts = productData.installableArtifacts();
- for (const ArtifactData &artifact : installableArtifacts) {
+ for (const ArtifactData &artifact : productData.installableArtifacts()) {
const QString &outputDir = artifact.installData().localInstallDir();
if (outputDir.contains(QLatin1Char(' '))) {
logger().qbsWarning() << Tr::tr("Skipping installation of '%1', because "