summaryrefslogtreecommitdiff
path: root/Source/CTest/cmCTestCurl.cxx
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2016-05-26 23:05:30 +0200
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2016-06-02 21:35:50 +0200
commitc6220de27605f33b2793729680c32714cd126690 (patch)
treeedd5725b84c0d2ed910b9ec945d3086f5324f9aa /Source/CTest/cmCTestCurl.cxx
parent9ca8c7a99f193179ebfc893060966c37e3efabca (diff)
downloadcmake-c6220de27605f33b2793729680c32714cd126690.tar.gz
Use the empty() method to check for emptyness.
Apply fix-its from clang-tidy's readability-container-size-empty checker.
Diffstat (limited to 'Source/CTest/cmCTestCurl.cxx')
-rw-r--r--Source/CTest/cmCTestCurl.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx
index 59675dd0e0..4818324fe7 100644
--- a/Source/CTest/cmCTestCurl.cxx
+++ b/Source/CTest/cmCTestCurl.cxx
@@ -88,10 +88,10 @@ bool cmCTestCurl::InitCurl()
if (this->VerifyHostOff) {
curl_easy_setopt(this->Curl, CURLOPT_SSL_VERIFYHOST, 0);
}
- if (this->HTTPProxy.size()) {
+ if (!this->HTTPProxy.empty()) {
curl_easy_setopt(this->Curl, CURLOPT_PROXY, this->HTTPProxy.c_str());
curl_easy_setopt(this->Curl, CURLOPT_PROXYTYPE, this->HTTPProxyType);
- if (this->HTTPProxyAuth.size() > 0) {
+ if (!this->HTTPProxyAuth.empty()) {
curl_easy_setopt(this->Curl, CURLOPT_PROXYUSERPWD,
this->HTTPProxyAuth.c_str());
}
@@ -160,17 +160,17 @@ bool cmCTestCurl::UploadFile(std::string const& local_file,
::curl_easy_setopt(this->Curl, CURLOPT_HTTPHEADER, NULL);
::curl_slist_free_all(headers);
- if (responseData.size() > 0) {
+ if (!responseData.empty()) {
response = std::string(responseData.begin(), responseData.end());
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Curl response: ["
<< response << "]\n");
}
std::string curlDebug;
- if (debugData.size() > 0) {
+ if (!debugData.empty()) {
curlDebug = std::string(debugData.begin(), debugData.end());
cmCTestLog(this->CTest, DEBUG, "Curl debug: [" << curlDebug << "]\n");
}
- if (response.size() == 0) {
+ if (response.empty()) {
cmCTestLog(this->CTest, ERROR_MESSAGE, "No response from server.\n"
<< curlDebug);
return false;
@@ -205,11 +205,11 @@ bool cmCTestCurl::HttpRequest(std::string const& url,
CURLcode res = ::curl_easy_perform(this->Curl);
- if (responseData.size() > 0) {
+ if (!responseData.empty()) {
response = std::string(responseData.begin(), responseData.end());
cmCTestLog(this->CTest, DEBUG, "Curl response: [" << response << "]\n");
}
- if (debugData.size() > 0) {
+ if (!debugData.empty()) {
std::string curlDebug = std::string(debugData.begin(), debugData.end());
cmCTestLog(this->CTest, DEBUG, "Curl debug: [" << curlDebug << "]\n");
}