diff options
author | kwolekr <kwolekr@minetest.net> | 2015-05-19 02:24:14 -0400 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2015-05-19 16:10:49 -0400 |
commit | da34a2b33e1f600ec11172f599384b9a92835403 (patch) | |
tree | f09a158be783f0486447d0c61750a7509760d83b /src/httpfetch.cpp | |
parent | 603297cc352cab685dd01dcd645999624ad17c0b (diff) | |
download | minetest-da34a2b33e1f600ec11172f599384b9a92835403.tar.gz minetest-da34a2b33e1f600ec11172f599384b9a92835403.tar.bz2 minetest-da34a2b33e1f600ec11172f599384b9a92835403.zip |
Replace instances of std::map<std::string, std::string> with StringMap
Also, clean up surrounding code style
Replace by-value parameter passing with const refs when possible
Fix post-increment of iterators
Diffstat (limited to 'src/httpfetch.cpp')
-rw-r--r-- | src/httpfetch.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/httpfetch.cpp b/src/httpfetch.cpp index c60e141fc..56cdad2b1 100644 --- a/src/httpfetch.cpp +++ b/src/httpfetch.cpp @@ -266,8 +266,7 @@ HTTPFetchOngoing::HTTPFetchOngoing(HTTPFetchRequest request_, CurlHandlePool *po curl_easy_setopt(curl, CURLOPT_HTTPGET, 1); } else if (request.multipart) { curl_httppost *last = NULL; - for (std::map<std::string, std::string>::iterator it = - request.post_fields.begin(); + for (StringMap::iterator it = request.post_fields.begin(); it != request.post_fields.end(); ++it) { curl_formadd(&post, &last, CURLFORM_NAMELENGTH, it->first.size(), @@ -282,10 +281,8 @@ HTTPFetchOngoing::HTTPFetchOngoing(HTTPFetchRequest request_, CurlHandlePool *po } else if (request.post_data.empty()) { curl_easy_setopt(curl, CURLOPT_POST, 1); std::string str; - for (std::map<std::string, std::string>::iterator it = - request.post_fields.begin(); - it != request.post_fields.end(); - ++it) { + for (StringMap::iterator it = request.post_fields.begin(); + it != request.post_fields.end(); ++it) { if (str != "") str += "&"; str += urlencode(it->first); |