From 8526ceeb452d23d7aa73d01c6cb0fc8ae5e0377b Mon Sep 17 00:00:00 2001 From: Nils Maier Date: Wed, 21 Aug 2013 05:06:53 +0200 Subject: Convert to autos and ranged loops --- src/StreamFileAllocationEntry.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/StreamFileAllocationEntry.cc') diff --git a/src/StreamFileAllocationEntry.cc b/src/StreamFileAllocationEntry.cc index d30018a2..dfe1f679 100644 --- a/src/StreamFileAllocationEntry.cc +++ b/src/StreamFileAllocationEntry.cc @@ -73,13 +73,10 @@ void StreamFileAllocationEntry::prepareForNextAction getRequestGroup()->getDownloadContext(); const std::vector >& fileEntries = dctx->getFileEntries(); - for(std::vector >::const_iterator i = - fileEntries.begin(), eoi = fileEntries.end(); i != eoi; ++i) { - const FileEntry::InFlightRequestSet& reqs = - (*i)->getInFlightRequests(); - for(FileEntry::InFlightRequestSet::iterator j = - reqs.begin(), eoj = reqs.end(); j != eoj; ++j) { - const std::shared_ptr& peerStat = (*j)->getPeerStat(); + for(auto & f : fileEntries) { + const auto& reqs = f->getInFlightRequests(); + for(auto & req : reqs) { + const std::shared_ptr& peerStat = req->getPeerStat(); if(peerStat) { peerStat->downloadStart(); } -- cgit