summaryrefslogtreecommitdiff
path: root/src/StreamFileAllocationEntry.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2015-12-27 18:39:47 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2015-12-27 18:40:08 +0900
commitb1132d6b10cd3791b9529d7031d723fd0e2d8215 (patch)
tree9ce465b42bf09372118335c7c619bb2b41869eaf /src/StreamFileAllocationEntry.cc
parent4abad2f64c9ff80144a61c5a9c2bea144852b883 (diff)
make clang-format using clang-format-3.6
Diffstat (limited to 'src/StreamFileAllocationEntry.cc')
-rw-r--r--src/StreamFileAllocationEntry.cc37
1 files changed, 19 insertions, 18 deletions
diff --git a/src/StreamFileAllocationEntry.cc b/src/StreamFileAllocationEntry.cc
index de851da6..c6d1de2a 100644
--- a/src/StreamFileAllocationEntry.cc
+++ b/src/StreamFileAllocationEntry.cc
@@ -49,38 +49,38 @@
namespace aria2 {
-StreamFileAllocationEntry::StreamFileAllocationEntry
-(RequestGroup* requestGroup, std::unique_ptr<Command> nextCommand):
- FileAllocationEntry(requestGroup, std::move(nextCommand))
-{}
+StreamFileAllocationEntry::StreamFileAllocationEntry(
+ RequestGroup* requestGroup, std::unique_ptr<Command> nextCommand)
+ : FileAllocationEntry(requestGroup, std::move(nextCommand))
+{
+}
StreamFileAllocationEntry::~StreamFileAllocationEntry() {}
-void StreamFileAllocationEntry::prepareForNextAction
-(std::vector<std::unique_ptr<Command>>& commands,
- DownloadEngine* e)
+void StreamFileAllocationEntry::prepareForNextAction(
+ std::vector<std::unique_ptr<Command>>& commands, DownloadEngine* e)
{
- auto &option = getRequestGroup()->getOption();
+ auto& option = getRequestGroup()->getOption();
// For DownloadContext::resetDownloadStartTime(), see also
// RequestGroup::createInitialCommand()
getRequestGroup()->getDownloadContext()->resetDownloadStartTime();
- if(option->getAsBool(PREF_ENABLE_MMAP) &&
- option->get(PREF_FILE_ALLOCATION) != V_NONE) {
+ if (option->getAsBool(PREF_ENABLE_MMAP) &&
+ option->get(PREF_FILE_ALLOCATION) != V_NONE) {
getRequestGroup()->getPieceStorage()->getDiskAdaptor()->enableMmap();
}
- if(getNextCommand()) {
+ if (getNextCommand()) {
// Reset download start time of PeerStat because it is started
// before file allocation begins.
const std::shared_ptr<DownloadContext>& dctx =
- getRequestGroup()->getDownloadContext();
- const std::vector<std::shared_ptr<FileEntry> >& fileEntries =
- dctx->getFileEntries();
- for(auto & f : fileEntries) {
+ getRequestGroup()->getDownloadContext();
+ const std::vector<std::shared_ptr<FileEntry>>& fileEntries =
+ dctx->getFileEntries();
+ for (auto& f : fileEntries) {
const auto& reqs = f->getInFlightRequests();
- for(auto & req : reqs) {
+ for (auto& req : reqs) {
const std::shared_ptr<PeerStat>& peerStat = req->getPeerStat();
- if(peerStat) {
+ if (peerStat) {
peerStat->downloadStart();
}
}
@@ -91,7 +91,8 @@ void StreamFileAllocationEntry::prepareForNextAction
commands.push_back(popNextCommand());
// try remaining uris
getRequestGroup()->createNextCommandWithAdj(commands, e, -1);
- } else {
+ }
+ else {
getRequestGroup()->createNextCommandWithAdj(commands, e, 0);
}
}