summaryrefslogtreecommitdiffstats
path: root/Source/cmMessageCommand.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-01-14 20:27:25 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-02-11 21:57:55 (GMT)
commit27c6f017a1ef7c62f7f0332d624add7e8189f81c (patch)
tree5a8c5eb60837b1892092f79905d287950658e552 /Source/cmMessageCommand.cxx
parent4e78ebbdf94b99f7b7d5b9b31d05dd9479b1d6ab (diff)
downloadCMake-27c6f017a1ef7c62f7f0332d624add7e8189f81c.zip
CMake-27c6f017a1ef7c62f7f0332d624add7e8189f81c.tar.gz
CMake-27c6f017a1ef7c62f7f0332d624add7e8189f81c.tar.bz2
Use cmJoin to accumulate string ranges.
Avoid using the std::accumulate algorithm which is designed for numeric types, not complex types. It introduces unneccessary copies. Initialize variables where they are populated.
Diffstat (limited to 'Source/cmMessageCommand.cxx')
-rw-r--r--Source/cmMessageCommand.cxx6
1 files changed, 1 insertions, 5 deletions
diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx
index 88d6a77..0449c50 100644
--- a/Source/cmMessageCommand.cxx
+++ b/Source/cmMessageCommand.cxx
@@ -20,7 +20,6 @@ bool cmMessageCommand
this->SetError("called with incorrect number of arguments");
return false;
}
- std::string message;
std::vector<std::string>::const_iterator i = args.begin();
cmake::MessageType type = cmake::MESSAGE;
@@ -70,10 +69,7 @@ bool cmMessageCommand
++i;
}
- for(;i != args.end(); ++i)
- {
- message += *i;
- }
+ std::string message = cmJoin(cmRange(i, args.end()), std::string());
if (type != cmake::MESSAGE)
{