From 6b397c812520016f7b2b22544f51bfddbcca8dfe Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 6 Jul 2013 00:17:44 +0900 Subject: Use std::unique_ptr for CheckIntegrityEntry and FileAllocationEntry --- src/StreamCheckIntegrityEntry.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/StreamCheckIntegrityEntry.cc') 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>& commands, DownloadEngine* e) { - const std::shared_ptr& ps = getRequestGroup()->getPieceStorage(); + auto& ps = getRequestGroup()->getPieceStorage(); ps->onDownloadIncomplete(); if(getRequestGroup()->getOption()->getAsBool(PREF_HASH_CHECK_ONLY)) { return; } - std::shared_ptr entry - (new StreamFileAllocationEntry(getRequestGroup(), popNextCommand())); - proceedFileAllocation(commands, entry, e); + proceedFileAllocation(commands, + make_unique + (getRequestGroup(), popNextCommand()), + e); } void StreamCheckIntegrityEntry::onDownloadFinished -- cgit