diff options
author | Artur Ryt <artur.ryt@gmail.com> | 2019-02-04 21:56:42 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-02-06 15:43:16 (GMT) |
commit | f3534386b504430aec926e46a413b044ff64d769 (patch) | |
tree | cb29c859cee6cdc69c0d8b25d719b4096be53ff8 /Source/cmCTest.cxx | |
parent | 062cfd991faac000d484c74e5af7d65726c655dc (diff) | |
download | CMake-f3534386b504430aec926e46a413b044ff64d769.zip CMake-f3534386b504430aec926e46a413b044ff64d769.tar.gz CMake-f3534386b504430aec926e46a413b044ff64d769.tar.bz2 |
Prefer front/back/data over dereferencing begin/rbegin iter
Changed for sequenced containers: vector, list, string and array
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r-- | Source/cmCTest.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 989c7ee..ba2fe6c 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1039,7 +1039,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output, // Now create process object cmsysProcess* cp = cmsysProcess_New(); - cmsysProcess_SetCommand(cp, &*argv.begin()); + cmsysProcess_SetCommand(cp, argv.data()); cmsysProcess_SetWorkingDirectory(cp, dir); cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1); cmsysProcess_SetTimeout(cp, timeout.count()); @@ -1222,7 +1222,7 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output, } cmsysProcess* cp = cmsysProcess_New(); - cmsysProcess_SetCommand(cp, &*argv.begin()); + cmsysProcess_SetCommand(cp, argv.data()); cmCTestLog(this, DEBUG, "Command is: " << argv[0] << std::endl); if (cmSystemTools::GetRunCommandHideConsole()) { cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1); @@ -1258,7 +1258,7 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output, cmsysProcess_WaitForExit(cp, nullptr); processOutput.DecodeText(tempOutput, tempOutput); if (output && tempOutput.begin() != tempOutput.end()) { - output->append(&*tempOutput.begin(), tempOutput.size()); + output->append(tempOutput.data(), tempOutput.size()); } cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "-- Process completed" << std::endl); @@ -2776,7 +2776,7 @@ bool cmCTest::RunCommand(std::vector<std::string> const& args, stdErr->clear(); cmsysProcess* cp = cmsysProcess_New(); - cmsysProcess_SetCommand(cp, &*argv.begin()); + cmsysProcess_SetCommand(cp, argv.data()); cmsysProcess_SetWorkingDirectory(cp, dir); if (cmSystemTools::GetRunCommandHideConsole()) { cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1); @@ -2820,11 +2820,11 @@ bool cmCTest::RunCommand(std::vector<std::string> const& args, cmsysProcess_WaitForExit(cp, nullptr); if (!tempOutput.empty()) { processOutput.DecodeText(tempOutput, tempOutput); - stdOut->append(&*tempOutput.begin(), tempOutput.size()); + stdOut->append(tempOutput.data(), tempOutput.size()); } if (!tempError.empty()) { processOutput.DecodeText(tempError, tempError); - stdErr->append(&*tempError.begin(), tempError.size()); + stdErr->append(tempError.data(), tempError.size()); } bool result = true; @@ -3048,7 +3048,7 @@ void cmCTest::OutputTestErrors(std::vector<char> const& process_output) { std::string test_outputs("\n*** Test Failed:\n"); if (!process_output.empty()) { - test_outputs.append(&*process_output.begin(), process_output.size()); + test_outputs.append(process_output.data(), process_output.size()); } cmCTestLog(this, HANDLER_OUTPUT, test_outputs << std::endl << std::flush); } |