diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-07-06 00:17:44 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-07-06 15:56:08 +0900 |
| commit | 6b397c812520016f7b2b22544f51bfddbcca8dfe (patch) | |
| tree | 6dcf656fb19da47833324111efcee62c66809365 /src/StreamCheckIntegrityEntry.cc | |
| parent | c9e58779e1a30b32ea2f86e686211d901aca19f0 (diff) | |
Use std::unique_ptr for CheckIntegrityEntry and FileAllocationEntry
Diffstat (limited to 'src/StreamCheckIntegrityEntry.cc')
| -rw-r--r-- | src/StreamCheckIntegrityEntry.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/StreamCheckIntegrityEntry.cc b/src/StreamCheckIntegrityEntry.cc index e245f18e..aa345806 100644 --- a/src/StreamCheckIntegrityEntry.cc +++ b/src/StreamCheckIntegrityEntry.cc @@ -52,14 +52,15 @@ StreamCheckIntegrityEntry::~StreamCheckIntegrityEntry() {} void StreamCheckIntegrityEntry::onDownloadIncomplete (std::vector<std::unique_ptr<Command>>& commands, DownloadEngine* e) { - const std::shared_ptr<PieceStorage>& ps = getRequestGroup()->getPieceStorage(); + auto& ps = getRequestGroup()->getPieceStorage(); ps->onDownloadIncomplete(); if(getRequestGroup()->getOption()->getAsBool(PREF_HASH_CHECK_ONLY)) { return; } - std::shared_ptr<FileAllocationEntry> entry - (new StreamFileAllocationEntry(getRequestGroup(), popNextCommand())); - proceedFileAllocation(commands, entry, e); + proceedFileAllocation(commands, + make_unique<StreamFileAllocationEntry> + (getRequestGroup(), popNextCommand()), + e); } void StreamCheckIntegrityEntry::onDownloadFinished |
