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/HttpResponseCommand.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/HttpResponseCommand.cc') diff --git a/src/HttpResponseCommand.cc b/src/HttpResponseCommand.cc index b6027f24..4b232d42 100644 --- a/src/HttpResponseCommand.cc +++ b/src/HttpResponseCommand.cc @@ -377,7 +377,7 @@ bool HttpResponseCommand::handleDefaultEncoding getFileEntry()->poolRequest(getRequest()); } - prepareForNextAction(checkEntry); + prepareForNextAction(std::move(checkEntry)); if(getRequest()->getMethod() == Request::METHOD_HEAD) { poolConnection(); @@ -421,11 +421,11 @@ bool HttpResponseCommand::handleOtherEncoding // See also FtpNegotiationCommand::onFileSizeDetermined() if(getDownloadContext()->isChecksumVerificationNeeded()) { A2_LOG_DEBUG("Zero length file exists. Verify checksum."); - std::shared_ptr entry - (new ChecksumCheckIntegrityEntry(getRequestGroup())); + auto entry = make_unique + (getRequestGroup()); entry->initValidator(); getPieceStorage()->getDiskAdaptor()->openExistingFile(); - getDownloadEngine()->getCheckIntegrityMan()->pushEntry(entry); + getDownloadEngine()->getCheckIntegrityMan()->pushEntry(std::move(entry)); } else #endif // ENABLE_MESSAGE_DIGEST { @@ -455,10 +455,10 @@ bool HttpResponseCommand::handleOtherEncoding #ifdef ENABLE_MESSAGE_DIGEST if(getDownloadContext()->isChecksumVerificationNeeded()) { A2_LOG_DEBUG("Verify checksum for zero-length file"); - auto entry = std::make_shared + auto entry = make_unique (getRequestGroup()); entry->initValidator(); - getDownloadEngine()->getCheckIntegrityMan()->pushEntry(entry); + getDownloadEngine()->getCheckIntegrityMan()->pushEntry(std::move(entry)); } else #endif // ENABLE_MESSAGE_DIGEST { -- cgit