diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-05-23 12:49:54 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2019-05-23 14:19:49 (GMT) |
commit | 006229278b54ee92003100773a0430565fb8fe87 (patch) | |
tree | 04a9927d32bf98df5685fde3b0e5be4811e67f8d /Source/cmFileCommand.cxx | |
parent | 999516478d56d8604d1413fe3c677a860357516c (diff) | |
download | CMake-006229278b54ee92003100773a0430565fb8fe87.zip CMake-006229278b54ee92003100773a0430565fb8fe87.tar.gz CMake-006229278b54ee92003100773a0430565fb8fe87.tar.bz2 |
Use cmAppend to append ranges to std::vector instances
Diffstat (limited to 'Source/cmFileCommand.cxx')
-rw-r--r-- | Source/cmFileCommand.cxx | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index c0e263a..7a3954e 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -890,7 +890,7 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args, } std::vector<std::string>& foundFiles = g.GetFiles(); - files.insert(files.end(), foundFiles.begin(), foundFiles.end()); + cmAppend(files, foundFiles); if (configureDepends) { std::sort(foundFiles.begin(), foundFiles.end()); @@ -1476,23 +1476,22 @@ size_t cmWriteToMemoryCallback(void* ptr, size_t size, size_t nmemb, void* data) { int realsize = static_cast<int>(size * nmemb); - cmFileCommandVectorOfChar* vec = - static_cast<cmFileCommandVectorOfChar*>(data); const char* chPtr = static_cast<char*>(ptr); - vec->insert(vec->end(), chPtr, chPtr + realsize); + cmAppend(*static_cast<cmFileCommandVectorOfChar*>(data), chPtr, + chPtr + realsize); return realsize; } size_t cmFileCommandCurlDebugCallback(CURL*, curl_infotype type, char* chPtr, size_t size, void* data) { - cmFileCommandVectorOfChar* vec = - static_cast<cmFileCommandVectorOfChar*>(data); + cmFileCommandVectorOfChar& vec = + *static_cast<cmFileCommandVectorOfChar*>(data); switch (type) { case CURLINFO_TEXT: case CURLINFO_HEADER_IN: case CURLINFO_HEADER_OUT: - vec->insert(vec->end(), chPtr, chPtr + size); + cmAppend(vec, chPtr, chPtr + size); break; case CURLINFO_DATA_IN: case CURLINFO_DATA_OUT: @@ -1502,7 +1501,7 @@ size_t cmFileCommandCurlDebugCallback(CURL*, curl_infotype type, char* chPtr, int n = sprintf(buf, "[%" KWIML_INT_PRIu64 " bytes data]\n", static_cast<KWIML_INT_uint64_t>(size)); if (n > 0) { - vec->insert(vec->end(), buf, buf + n); + cmAppend(vec, buf, buf + n); } } break; default: |