Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/DefaultWebRequestCurl.cpp

Issue 29391775: Issue 5013 - Improve some const-correctness (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Created March 22, 2017, 3:37 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/FilterEngine.cpp » ('j') | src/WebRequestJsObject.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/DefaultWebRequestCurl.cpp
===================================================================
--- a/src/DefaultWebRequestCurl.cpp
+++ b/src/DefaultWebRequestCurl.cpp
@@ -139,29 +139,27 @@ AdblockPlus::ServerResponse AdblockPlus:
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, ReceiveData);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &responseText);
// Request compressed data. Using any supported aglorithm
curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, "");
curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, ReceiveHeader);
curl_easy_setopt(curl, CURLOPT_HEADERDATA, &headerData);
struct curl_slist* headerList = 0;
- for (HeaderList::const_iterator it = requestHeaders.begin();
- it != requestHeaders.end(); ++it)
+ for (auto it = requestHeaders.cbegin(); it != requestHeaders.cend(); ++it)
{
headerList = curl_slist_append(headerList, (it->first + ": " + it->second).c_str());
}
if (headerList)
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerList);
result.status = ConvertErrorCode(curl_easy_perform(curl));
result.responseStatus = headerData.status;
result.responseText = responseText.str();
- for (std::vector<std::string>::iterator it = headerData.headers.begin();
- it != headerData.headers.end(); ++it)
+ for (auto it = headerData.headers.cbegin(); it != headerData.headers.cend(); ++it)
{
// Parse header name and value out of something like "Foo: bar"
std::string header = *it;
size_t colonPos = header.find(':');
if (colonPos != std::string::npos)
{
size_t nameStart = 0;
size_t nameEnd = colonPos;
« no previous file with comments | « no previous file | src/FilterEngine.cpp » ('j') | src/WebRequestJsObject.cpp » ('J')

Powered by Google App Engine
This is Rietveld