summaryrefslogtreecommitdiff
path: root/src/FileEntry.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2014-09-13 00:07:21 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2014-09-13 00:07:21 +0900
commit2807258279d8ddbef01ca1c20a87c14aa084620c (patch)
treee0baa98d1b2051898a4dbde0820ed81e6438fec4 /src/FileEntry.cc
parentbee7a8317c602a37066a7b3391b5134f31e3a5ff (diff)
Use std::make_shared and make_unique where possible, part 1
Diffstat (limited to 'src/FileEntry.cc')
-rw-r--r--src/FileEntry.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/FileEntry.cc b/src/FileEntry.cc
index c12a9182..bcf75f26 100644
--- a/src/FileEntry.cc
+++ b/src/FileEntry.cc
@@ -158,7 +158,7 @@ FileEntry::getRequest
if(uri.empty()) {
break;
}
- req.reset(new Request());
+ req = std::make_shared<Request>();
if(req->setUri(uri)) {
if(std::count(inFlightHosts.begin(),
inFlightHosts.end(),req->getHost())
@@ -293,7 +293,7 @@ FileEntry::findFasterRequest
}
if(!fastCands.empty()) {
std::sort(fastCands.begin(), fastCands.end(), ServerStatFaster());
- std::shared_ptr<Request> fastestRequest(new Request());
+ auto fastestRequest = std::make_shared<Request>();
const std::string& uri = fastCands.front().second;
A2_LOG_DEBUG(fmt("Selected %s from fastCands", uri.c_str()));
// Candidate URIs where already parsed when populating fastCands.