summaryrefslogtreecommitdiff
path: root/Source/CTest
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2016-05-26 22:21:15 +0200
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2016-05-26 22:21:15 +0200
commit27ead963052b4c3f4e40ea9e6141ba9902ad310a (patch)
tree69996681031307b34c930d51e0b3406fedf74236 /Source/CTest
parent618fb23fc9838d344e2033c64bfc1a3a55bb7f61 (diff)
downloadcmake-27ead963052b4c3f4e40ea9e6141ba9902ad310a.tar.gz
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')
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx1
-rw-r--r--Source/CTest/cmCTestSubmitCommand.cxx7
-rw-r--r--Source/CTest/cmCTestUploadCommand.cxx7
3 files changed, 6 insertions, 9 deletions
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 1f2d29c96d..b366930e2a 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -1356,7 +1356,6 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
return 0;
}
std::string testingDir = this->CTest->GetBinaryDir();
- std::string tempDir = testingDir;
std::string currentDirectory = cmSystemTools::GetCurrentWorkingDirectory();
std::set<std::string> missingFiles;
diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx
index fa9bd2cf7e..664552af99 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;
diff --git a/Source/CTest/cmCTestUploadCommand.cxx b/Source/CTest/cmCTestUploadCommand.cxx
index 6813cbcc46..c85db0208d 100644
--- a/Source/CTest/cmCTestUploadCommand.cxx
+++ b/Source/CTest/cmCTestUploadCommand.cxx
@@ -46,13 +46,12 @@ bool cmCTestUploadCommand::CheckArgumentKeyword(std::string const& arg)
bool cmCTestUploadCommand::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);
return true;
} 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;