summaryrefslogtreecommitdiff
path: root/src/PieceHashCheckIntegrityEntry.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-07-05 22:48:34 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-07-06 15:56:08 +0900
commitc9e58779e1a30b32ea2f86e686211d901aca19f0 (patch)
tree4acaa3ca196446f67e17b1ab06f2621a50b5c08b /src/PieceHashCheckIntegrityEntry.cc
parentd3a04d10a72b00487eb3c994bd3d0405e11c4789 (diff)
Use std::unique_ptr for IteratableValidator
Diffstat (limited to 'src/PieceHashCheckIntegrityEntry.cc')
-rw-r--r--src/PieceHashCheckIntegrityEntry.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/PieceHashCheckIntegrityEntry.cc b/src/PieceHashCheckIntegrityEntry.cc
index 41d2eec2..1356fc11 100644
--- a/src/PieceHashCheckIntegrityEntry.cc
+++ b/src/PieceHashCheckIntegrityEntry.cc
@@ -37,13 +37,15 @@
#include "IteratableChunkChecksumValidator.h"
#include "DownloadContext.h"
#include "PieceStorage.h"
+#include "a2functional.h"
namespace aria2 {
PieceHashCheckIntegrityEntry::PieceHashCheckIntegrityEntry
(RequestGroup* requestGroup,
- std::unique_ptr<Command> nextCommand):
- CheckIntegrityEntry(requestGroup, std::move(nextCommand)) {}
+ std::unique_ptr<Command> nextCommand)
+ : CheckIntegrityEntry{requestGroup, std::move(nextCommand)}
+{}
PieceHashCheckIntegrityEntry::~PieceHashCheckIntegrityEntry() {}
@@ -57,12 +59,11 @@ bool PieceHashCheckIntegrityEntry::isValidationReady()
void PieceHashCheckIntegrityEntry::initValidator()
{
#ifdef ENABLE_MESSAGE_DIGEST
- std::shared_ptr<IteratableChunkChecksumValidator> validator
- (new IteratableChunkChecksumValidator
- (getRequestGroup()->getDownloadContext(),
- getRequestGroup()->getPieceStorage()));
+ auto validator = make_unique<IteratableChunkChecksumValidator>
+ (getRequestGroup()->getDownloadContext(),
+ getRequestGroup()->getPieceStorage());
validator->init();
- setValidator(validator);
+ setValidator(std::move(validator));
#endif // ENABLE_MESSAGE_DIGEST
}