diff options
author | Brad King <brad.king@kitware.com> | 2016-05-27 13:08:21 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-05-27 13:08:21 (GMT) |
commit | fb1f5d50af2bc97b8dfe783998a66a7a4bea140e (patch) | |
tree | 1b55b11e2626dbf1dc948cce00094d528dbde7c1 /Source/CTest | |
parent | 82c286393afb15346431a8a3f601819698fcb87f (diff) | |
parent | 27ead963052b4c3f4e40ea9e6141ba9902ad310a (diff) | |
download | CMake-fb1f5d50af2bc97b8dfe783998a66a7a4bea140e.zip CMake-fb1f5d50af2bc97b8dfe783998a66a7a4bea140e.tar.gz CMake-fb1f5d50af2bc97b8dfe783998a66a7a4bea140e.tar.bz2 |
Merge topic 'remove-needless-copies'
27ead963 Remove unnecessary local copies.
618fb23f Pass arguments that are not modified as const&.
Diffstat (limited to 'Source/CTest')
-rw-r--r-- | Source/CTest/cmCTestCoverageHandler.cxx | 3 | ||||
-rw-r--r-- | Source/CTest/cmCTestCoverageHandler.h | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestMultiProcessHandler.cxx | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestMultiProcessHandler.h | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestSubmitCommand.cxx | 7 | ||||
-rw-r--r-- | Source/CTest/cmCTestUploadCommand.cxx | 7 | ||||
-rw-r--r-- | Source/CTest/cmParseBlanketJSCoverage.cxx | 4 | ||||
-rw-r--r-- | Source/CTest/cmParseBlanketJSCoverage.h | 2 | ||||
-rw-r--r-- | Source/CTest/cmParseDelphiCoverage.cxx | 4 | ||||
-rw-r--r-- | Source/CTest/cmParseDelphiCoverage.h | 2 | ||||
-rw-r--r-- | Source/CTest/cmParseJacocoCoverage.cxx | 8 | ||||
-rw-r--r-- | Source/CTest/cmParseJacocoCoverage.h | 2 |
12 files changed, 21 insertions, 24 deletions
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index 7f0bf2c..daefb59 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; @@ -1759,7 +1758,7 @@ int cmCTestCoverageHandler::HandleTracePyCoverage( } std::string cmCTestCoverageHandler::FindFile( - cmCTestCoverageHandlerContainer* cont, std::string fileName) + cmCTestCoverageHandlerContainer* cont, std::string const& fileName) { std::string fileNameNoE = cmSystemTools::GetFilenameWithoutLastExtension(fileName); diff --git a/Source/CTest/cmCTestCoverageHandler.h b/Source/CTest/cmCTestCoverageHandler.h index 4a2a602..1773218 100644 --- a/Source/CTest/cmCTestCoverageHandler.h +++ b/Source/CTest/cmCTestCoverageHandler.h @@ -119,7 +119,7 @@ private: // Find the source file based on the source and build tree. This is used for // Trace.py mode, since that one does not tell us where the source file is. std::string FindFile(cmCTestCoverageHandlerContainer* cont, - std::string fileName); + std::string const& fileName); std::set<std::string> FindUncoveredFiles( cmCTestCoverageHandlerContainer* cont); diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index d155023..6f19b32 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -500,7 +500,7 @@ void cmCTestMultiProcessHandler::ReadCostData() } } -int cmCTestMultiProcessHandler::SearchByName(std::string name) +int cmCTestMultiProcessHandler::SearchByName(std::string const& name) { int index = -1; diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h index cb709cc..9ec1528 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.h +++ b/Source/CTest/cmCTestMultiProcessHandler.h @@ -84,7 +84,7 @@ protected: void UpdateCostData(); void ReadCostData(); // Return index of a test based on its name - int SearchByName(std::string name); + int SearchByName(std::string const& name); void CreateTestCostList(); 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; diff --git a/Source/CTest/cmCTestUploadCommand.cxx b/Source/CTest/cmCTestUploadCommand.cxx index 6813cbc..c85db02 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; diff --git a/Source/CTest/cmParseBlanketJSCoverage.cxx b/Source/CTest/cmParseBlanketJSCoverage.cxx index 152c354..fa539e4 100644 --- a/Source/CTest/cmParseBlanketJSCoverage.cxx +++ b/Source/CTest/cmParseBlanketJSCoverage.cxx @@ -46,7 +46,7 @@ public: return line.substr(begIndex, line.npos); } } - bool ParseFile(std::string file) + bool ParseFile(std::string const& file) { FileLinesType localCoverageVector; std::string filename; @@ -138,7 +138,7 @@ bool cmParseBlanketJSCoverage::LoadCoverageData(std::vector<std::string> files) return true; } -bool cmParseBlanketJSCoverage::ReadJSONFile(std::string file) +bool cmParseBlanketJSCoverage::ReadJSONFile(std::string const& file) { cmParseBlanketJSCoverage::JSONParser parser(this->Coverage); cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, diff --git a/Source/CTest/cmParseBlanketJSCoverage.h b/Source/CTest/cmParseBlanketJSCoverage.h index 4fc64e7..a4f6670 100644 --- a/Source/CTest/cmParseBlanketJSCoverage.h +++ b/Source/CTest/cmParseBlanketJSCoverage.h @@ -35,7 +35,7 @@ public: cmCTest* ctest); bool LoadCoverageData(std::vector<std::string> files); // Read the JSON output - bool ReadJSONFile(std::string file); + bool ReadJSONFile(std::string const& file); protected: class JSONParser; diff --git a/Source/CTest/cmParseDelphiCoverage.cxx b/Source/CTest/cmParseDelphiCoverage.cxx index 2e06078..9d86ce9 100644 --- a/Source/CTest/cmParseDelphiCoverage.cxx +++ b/Source/CTest/cmParseDelphiCoverage.cxx @@ -22,7 +22,7 @@ public: virtual ~HTMLParser() {} bool initializeDelphiFile( - const std::string filename, + std::string const& filename, cmParseDelphiCoverage::HTMLParser::FileLinesType& coverageVector) { std::string line; @@ -197,7 +197,7 @@ cmParseDelphiCoverage::cmParseDelphiCoverage( } bool cmParseDelphiCoverage::LoadCoverageData( - const std::vector<std::string> files) + std::vector<std::string> const& files) { size_t i; std::string path; diff --git a/Source/CTest/cmParseDelphiCoverage.h b/Source/CTest/cmParseDelphiCoverage.h index 06dea2b..c1c495c 100644 --- a/Source/CTest/cmParseDelphiCoverage.h +++ b/Source/CTest/cmParseDelphiCoverage.h @@ -28,7 +28,7 @@ class cmParseDelphiCoverage { public: cmParseDelphiCoverage(cmCTestCoverageHandlerContainer& cont, cmCTest* ctest); - bool LoadCoverageData(const std::vector<std::string> files); + bool LoadCoverageData(std::vector<std::string> const& files); bool ReadDelphiHTML(const char* file); // Read a single HTML file from output bool ReadHTMLFile(const char* f); diff --git a/Source/CTest/cmParseJacocoCoverage.cxx b/Source/CTest/cmParseJacocoCoverage.cxx index 6afaca6..335535d 100644 --- a/Source/CTest/cmParseJacocoCoverage.cxx +++ b/Source/CTest/cmParseJacocoCoverage.cxx @@ -85,7 +85,7 @@ protected: } } - virtual bool FindPackagePath(const std::string fileName) + virtual bool FindPackagePath(std::string const& fileName) { // Search for the source file in the source directory. if (this->PackagePathFound(fileName, this->Coverage.SourceDir)) { @@ -99,8 +99,8 @@ protected: return false; } - virtual bool PackagePathFound(const std::string fileName, - const std::string baseDir) + virtual bool PackagePathFound(std::string const& fileName, + std::string const& baseDir) { // Search for the file in the baseDir and its subdirectories. std::string packageGlob = baseDir; @@ -149,7 +149,7 @@ cmParseJacocoCoverage::cmParseJacocoCoverage( } bool cmParseJacocoCoverage::LoadCoverageData( - const std::vector<std::string> files) + std::vector<std::string> const& files) { // load all the jacoco.xml files in the source directory cmsys::Directory dir; diff --git a/Source/CTest/cmParseJacocoCoverage.h b/Source/CTest/cmParseJacocoCoverage.h index fa31d47..bcd472e 100644 --- a/Source/CTest/cmParseJacocoCoverage.h +++ b/Source/CTest/cmParseJacocoCoverage.h @@ -27,7 +27,7 @@ class cmParseJacocoCoverage { public: cmParseJacocoCoverage(cmCTestCoverageHandlerContainer& cont, cmCTest* ctest); - bool LoadCoverageData(const std::vector<std::string> files); + bool LoadCoverageData(std::vector<std::string> const& files); std::string PackageName; std::string FileName; |