diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-06-23 00:59:55 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-06-23 00:59:55 +0900 |
| commit | bef6236da80cb18a3212bde7c33c556883cbd536 (patch) | |
| tree | 8faeefde90feeaeb0d7c52d75dcc5189f8c25ea0 /src/RequestGroup.cc | |
| parent | 1a299c4d7cf5ab8d130e678d152c4c47ae3430ea (diff) | |
DownloadContext::attrs_ now holds std::unique_ptr
DownloadContext::getAttribute() returns a raw pointer.
Diffstat (limited to 'src/RequestGroup.cc')
| -rw-r--r-- | src/RequestGroup.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/RequestGroup.cc b/src/RequestGroup.cc index 66bc2898..74e028fc 100644 --- a/src/RequestGroup.cc +++ b/src/RequestGroup.cc @@ -287,8 +287,7 @@ void RequestGroup::createInitialCommand #ifdef ENABLE_BITTORRENT { if(downloadContext_->hasAttribute(CTX_ATTR_BT)) { - std::shared_ptr<TorrentAttribute> torrentAttrs = - bittorrent::getTorrentAttrs(downloadContext_); + auto torrentAttrs = bittorrent::getTorrentAttrs(downloadContext_); bool metadataGetMode = torrentAttrs->metadata.empty(); if(option_->getAsBool(PREF_DRY_RUN)) { throw DOWNLOAD_FAILURE_EXCEPTION @@ -1207,8 +1206,7 @@ void RequestGroup::reportDownloadFinished() int64_t completedLength = getCompletedLength(); double shareRatio = completedLength == 0 ? 0.0 : 1.0*stat.allTimeUploadLength/completedLength; - std::shared_ptr<TorrentAttribute> attrs = - bittorrent::getTorrentAttrs(downloadContext_); + auto attrs = bittorrent::getTorrentAttrs(downloadContext_); if(!attrs->metadata.empty()) { A2_LOG_NOTICE(fmt(MSG_SHARE_RATIO_REPORT, shareRatio, |
