summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallCommand.cxx
diff options
context:
space:
mode:
authorPavel Solodovnikov <hellyeahdominate@gmail.com>2017-05-24 20:18:28 (GMT)
committerPavel Solodovnikov <hellyeahdominate@gmail.com>2017-05-26 16:50:11 (GMT)
commit86dc86dd6c66a6d61234efcddddddf466a6597d2 (patch)
treef7fcf0d9852d4d66b362a9c0fba67fd9d42661e8 /Source/cmInstallCommand.cxx
parent76bdb4076277cda0e68e1d80cdf715020eab5a7a (diff)
downloadCMake-86dc86dd6c66a6d61234efcddddddf466a6597d2.zip
CMake-86dc86dd6c66a6d61234efcddddddf466a6597d2.tar.gz
CMake-86dc86dd6c66a6d61234efcddddddf466a6597d2.tar.bz2
Add const-reference qualifications
Diffstat (limited to 'Source/cmInstallCommand.cxx')
-rw-r--r--Source/cmInstallCommand.cxx20
1 files changed, 11 insertions, 9 deletions
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index ba554aa..93e467c 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -75,29 +75,31 @@ bool cmInstallCommand::InitialPass(std::vector<std::string> const& args,
this->DefaultComponentName = "Unspecified";
}
+ std::string const& mode = args[0];
+
// Switch among the command modes.
- if (args[0] == "SCRIPT") {
+ if (mode == "SCRIPT") {
return this->HandleScriptMode(args);
}
- if (args[0] == "CODE") {
+ if (mode == "CODE") {
return this->HandleScriptMode(args);
}
- if (args[0] == "TARGETS") {
+ if (mode == "TARGETS") {
return this->HandleTargetsMode(args);
}
- if (args[0] == "FILES") {
+ if (mode == "FILES") {
return this->HandleFilesMode(args);
}
- if (args[0] == "PROGRAMS") {
+ if (mode == "PROGRAMS") {
return this->HandleFilesMode(args);
}
- if (args[0] == "DIRECTORY") {
+ if (mode == "DIRECTORY") {
return this->HandleDirectoryMode(args);
}
- if (args[0] == "EXPORT") {
+ if (mode == "EXPORT") {
return this->HandleExportMode(args);
}
- if (args[0] == "EXPORT_ANDROID_MK") {
+ if (mode == "EXPORT_ANDROID_MK") {
return this->HandleExportAndroidMKMode(args);
}
@@ -165,7 +167,7 @@ bool cmInstallCommand::HandleScriptMode(std::vector<std::string> const& args)
script.c_str(), false, component.c_str(), exclude_from_all));
} else if (doing_code) {
doing_code = false;
- std::string code = args[i];
+ std::string const& code = args[i];
this->Makefile->AddInstallGenerator(new cmInstallScriptGenerator(
code.c_str(), true, component.c_str(), exclude_from_all));
}