diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2016-05-26 20:21:15 (GMT) |
---|---|---|
committer | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2016-05-26 20:21:15 (GMT) |
commit | 27ead963052b4c3f4e40ea9e6141ba9902ad310a (patch) | |
tree | 69996681031307b34c930d51e0b3406fedf74236 /Source/CTest/cmCTestSubmitCommand.cxx | |
parent | 618fb23fc9838d344e2033c64bfc1a3a55bb7f61 (diff) | |
download | CMake-27ead963052b4c3f4e40ea9e6141ba9902ad310a.zip CMake-27ead963052b4c3f4e40ea9e6141ba9902ad310a.tar.gz CMake-27ead963052b4c3f4e40ea9e6141ba9902ad310a.tar.bz2 |
Remove unnecessary local copies.
Use clang-tidy's performance-unnecessary-copy-initialization checker.
After applying the fix-its (which turns the copies into const&), revise
the changes and see whether the copies can be removed entirely by using
the original instead.
Diffstat (limited to 'Source/CTest/cmCTestSubmitCommand.cxx')
-rw-r--r-- | Source/CTest/cmCTestSubmitCommand.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx index fa9bd2c..664552a 100644 --- a/Source/CTest/cmCTestSubmitCommand.cxx +++ b/Source/CTest/cmCTestSubmitCommand.cxx @@ -219,12 +219,11 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg) } if (this->ArgumentDoing == ArgumentDoingFiles) { - std::string filename(arg); - if (cmSystemTools::FileExists(filename.c_str())) { - this->Files.insert(filename); + if (cmSystemTools::FileExists(arg.c_str())) { + this->Files.insert(arg); } else { std::ostringstream e; - e << "File \"" << filename << "\" does not exist. Cannot submit " + e << "File \"" << arg << "\" does not exist. Cannot submit " << "a non-existent file."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); this->ArgumentDoing = ArgumentDoingError; |