diff options
| author | Nils Maier <maierman@web.de> | 2013-08-25 18:00:46 +0200 |
|---|---|---|
| committer | Nils Maier <maierman@web.de> | 2013-09-20 23:06:49 +0200 |
| commit | 3590077d5c43d492b3e357d1a50afca4a7d1cfcf (patch) | |
| tree | 592516aa08b74c7e90c41a9b50c227f3f5b877b0 /src/AdaptiveURISelector.cc | |
| parent | a76eeb2b8106dd725097750c3ee4958e505e3c85 (diff) | |
More auto-converts by cpp11-migrate
Diffstat (limited to 'src/AdaptiveURISelector.cc')
| -rw-r--r-- | src/AdaptiveURISelector.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/AdaptiveURISelector.cc b/src/AdaptiveURISelector.cc index 1001247d..5794ac88 100644 --- a/src/AdaptiveURISelector.cc +++ b/src/AdaptiveURISelector.cc @@ -263,18 +263,18 @@ std::string AdaptiveURISelector::getMaxDownloadSpeedUri { int max = -1; std::string uri = A2STR::NIL; - for(auto i = uris.begin(), eoi = uris.end(); i != eoi; ++i) { - std::shared_ptr<ServerStat> ss = getServerStats(*i); + for(auto& u : uris) { + std::shared_ptr<ServerStat> ss = getServerStats(u); if(!ss) continue; if((int)ss->getSingleConnectionAvgSpeed() > max) { max = ss->getSingleConnectionAvgSpeed(); - uri = (*i); + uri = u; } if((int)ss->getMultiConnectionAvgSpeed() > max) { max = ss->getMultiConnectionAvgSpeed(); - uri = (*i); + uri = u; } } return uri; @@ -284,13 +284,13 @@ std::deque<std::string> AdaptiveURISelector::getUrisBySpeed (const std::deque<std::string>& uris, int min) const { std::deque<std::string> bests; - for(auto i = uris.begin(), eoi = uris.end(); i != eoi; ++i) { - std::shared_ptr<ServerStat> ss = getServerStats(*i); + for(auto& uri : uris) { + std::shared_ptr<ServerStat> ss = getServerStats(uri); if(!ss) continue; if(ss->getSingleConnectionAvgSpeed() > min || ss->getMultiConnectionAvgSpeed() > min) { - bests.push_back(*i); + bests.push_back(uri); } } return bests; |
