summaryrefslogtreecommitdiff
path: root/Source/cmStringCommand.cxx
diff options
context:
space:
mode:
authorPavel Solodovnikov <hellyeahdominate@gmail.com>2017-05-24 23:18:28 +0300
committerPavel Solodovnikov <hellyeahdominate@gmail.com>2017-05-26 19:50:11 +0300
commit86dc86dd6c66a6d61234efcddddddf466a6597d2 (patch)
treef7fcf0d9852d4d66b362a9c0fba67fd9d42661e8 /Source/cmStringCommand.cxx
parent76bdb4076277cda0e68e1d80cdf715020eab5a7a (diff)
downloadcmake-86dc86dd6c66a6d61234efcddddddf466a6597d2.tar.gz
Add const-reference qualifications
Diffstat (limited to 'Source/cmStringCommand.cxx')
-rw-r--r--Source/cmStringCommand.cxx22
1 files changed, 11 insertions, 11 deletions
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx
index d6907e3e1d..7a097ba217 100644
--- a/Source/cmStringCommand.cxx
+++ b/Source/cmStringCommand.cxx
@@ -128,7 +128,7 @@ bool cmStringCommand::HandleToUpperLowerCommand(
return false;
}
- std::string outvar = args[2];
+ std::string const& outvar = args[2];
std::string output;
if (toUpper) {
@@ -149,7 +149,7 @@ bool cmStringCommand::HandleAsciiCommand(std::vector<std::string> const& args)
return false;
}
std::string::size_type cc;
- std::string outvar = args[args.size() - 1];
+ std::string const& outvar = args[args.size() - 1];
std::string output;
for (cc = 1; cc < args.size() - 1; cc++) {
int ch = atoi(args[cc].c_str());
@@ -212,7 +212,7 @@ bool cmStringCommand::HandleRegexCommand(std::vector<std::string> const& args)
this->SetError("sub-command REGEX requires a mode to be specified.");
return false;
}
- std::string mode = args[1];
+ std::string const& mode = args[1];
if (mode == "MATCH") {
if (args.size() < 5) {
this->SetError("sub-command REGEX, mode MATCH needs "
@@ -247,8 +247,8 @@ bool cmStringCommand::RegexMatch(std::vector<std::string> const& args)
{
//"STRING(REGEX MATCH <regular_expression> <output variable>
// <input> [<input>...])\n";
- std::string regex = args[2];
- std::string outvar = args[3];
+ std::string const& regex = args[2];
+ std::string const& outvar = args[3];
this->Makefile->ClearMatches();
// Compile the regular expression.
@@ -288,8 +288,8 @@ bool cmStringCommand::RegexMatchAll(std::vector<std::string> const& args)
{
//"STRING(REGEX MATCHALL <regular_expression> <output variable> <input>
// [<input>...])\n";
- std::string regex = args[2];
- std::string outvar = args[3];
+ std::string const& regex = args[2];
+ std::string const& outvar = args[3];
this->Makefile->ClearMatches();
// Compile the regular expression.
@@ -334,9 +334,9 @@ bool cmStringCommand::RegexReplace(std::vector<std::string> const& args)
{
//"STRING(REGEX REPLACE <regular_expression> <replace_expression>
// <output variable> <input> [<input>...])\n"
- std::string regex = args[2];
- std::string replace = args[3];
- std::string outvar = args[4];
+ std::string const& regex = args[2];
+ std::string const& replace = args[3];
+ std::string const& outvar = args[4];
// Pull apart the replace expression to find the escaped [0-9] values.
std::vector<RegexReplacement> replacement;
@@ -502,7 +502,7 @@ bool cmStringCommand::HandleCompareCommand(
this->SetError("sub-command COMPARE requires a mode to be specified.");
return false;
}
- std::string mode = args[1];
+ std::string const& mode = args[1];
if ((mode == "EQUAL") || (mode == "NOTEQUAL") || (mode == "LESS") ||
(mode == "LESS_EQUAL") || (mode == "GREATER") ||
(mode == "GREATER_EQUAL")) {