diff --git a/ChangeLog b/ChangeLog index 52043f52..6931b279 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-05-19 Tatsuhiro Tsujikawa + + Code cleanup. + * src/RequestGroupMan.cc + * src/UTMetadataPostDownloadHandler.cc + * src/XmlRpcMethodImpl.cc + 2010-05-15 Tatsuhiro Tsujikawa Store both whole checksum and piece hash in metalink file. diff --git a/src/RequestGroupMan.cc b/src/RequestGroupMan.cc index d9b73454..8f939e33 100644 --- a/src/RequestGroupMan.cc +++ b/src/RequestGroupMan.cc @@ -349,7 +349,7 @@ public: void operator()(const SharedHandle& group) { if(group->getNumCommand() == 0) { - SharedHandle dctx = group->getDownloadContext(); + const SharedHandle& dctx = group->getDownloadContext(); // DownloadContext::resetDownloadStopTime() is only called when // download completed. If // DownloadContext::getDownloadStopTime().isZero() is true, then diff --git a/src/UTMetadataPostDownloadHandler.cc b/src/UTMetadataPostDownloadHandler.cc index 672f6995..8f5ae4df 100644 --- a/src/UTMetadataPostDownloadHandler.cc +++ b/src/UTMetadataPostDownloadHandler.cc @@ -56,7 +56,7 @@ namespace aria2 { bool UTMetadataPostDownloadHandler::Criteria::match (const RequestGroup* requestGroup) const { - SharedHandle dctx = + const SharedHandle& dctx = requestGroup->getDownloadContext(); if(dctx->hasAttribute(bittorrent::BITTORRENT)) { const BDE& attrs = dctx->getAttribute(bittorrent::BITTORRENT); @@ -76,7 +76,7 @@ UTMetadataPostDownloadHandler::UTMetadataPostDownloadHandler(): void UTMetadataPostDownloadHandler::getNextRequestGroups (std::vector >& groups, RequestGroup* requestGroup) { - SharedHandle dctx = requestGroup->getDownloadContext(); + const SharedHandle& dctx =requestGroup->getDownloadContext(); const BDE& attrs = dctx->getAttribute(bittorrent::BITTORRENT); std::string metadata = util::toString(requestGroup->getPieceStorage()->getDiskAdaptor()); diff --git a/src/XmlRpcMethodImpl.cc b/src/XmlRpcMethodImpl.cc index 73fdf610..4a9129a4 100644 --- a/src/XmlRpcMethodImpl.cc +++ b/src/XmlRpcMethodImpl.cc @@ -1044,7 +1044,7 @@ BDE GetServersXmlRpcMethod::process throw DL_ABORT_EX(StringFormat("No active download for GID#%s", util::itos(gid).c_str()).str()); } - SharedHandle dctx = group->getDownloadContext(); + const SharedHandle& dctx = group->getDownloadContext(); const std::vector >& files = dctx->getFileEntries(); BDE result = BDE::list(); size_t index = 1; @@ -1099,7 +1099,7 @@ BDE ChangeUriXmlRpcMethod::process (StringFormat("Cannot remove URIs from GID#%s", util::itos(gid).c_str()).str()); } - SharedHandle dctx = group->getDownloadContext(); + const SharedHandle& dctx = group->getDownloadContext(); const std::vector >& files = dctx->getFileEntries(); if(files.size() <= index) { throw DL_ABORT_EX(StringFormat("fileIndex is out of range").str());