Skip to content

Commit

Permalink
Merge pull request #232 from whoshuu/misc/construct-fields-in-place
Browse files Browse the repository at this point in the history
Construct fields in place
  • Loading branch information
whoshuu committed Oct 27, 2017
2 parents fa51326 + 30a6633 commit 1224768
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions cpr/session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,6 @@ Response Session::Impl::makeRequest(CURL* curl) {
curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME, &elapsed);
curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &raw_url);

Error error(curl_error, curl_->error);

Cookies cookies;
struct curl_slist* raw_cookies;
curl_easy_getinfo(curl, CURLINFO_COOKIELIST, &raw_cookies);
Expand All @@ -407,14 +405,13 @@ Response Session::Impl::makeRequest(CURL* curl) {
}
curl_slist_free_all(raw_cookies);

auto header = cpr::util::parseHeader(header_string);
return Response{static_cast<std::int32_t>(response_code),
std::move(response_string),
std::move(header),
cpr::util::parseHeader(header_string),
std::move(raw_url),
elapsed,
std::move(cookies),
std::move(error)};
Error(curl_error, curl_->error)};
}

// clang-format off
Expand Down

0 comments on commit 1224768

Please sign in to comment.