From: Hugo Beauzée-Luyssen Date: Thu, 24 Nov 2011 15:33:20 +0000 (+0100) Subject: dash: RateBasedAdaptationLogic: Removing useless loop. X-Git-Tag: 1.3.0-git~116 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=1f72229677fa80f9af594c984afc9e32ea917d6e;p=vlc dash: RateBasedAdaptationLogic: Removing useless loop. Signed-off-by: Rémi Denis-Courmont --- diff --git a/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.cpp b/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.cpp index 498c7dfd90..03a3f8e513 100644 --- a/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.cpp +++ b/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.cpp @@ -67,15 +67,12 @@ Chunk* RateBasedAdaptationLogic::getNextChunk () throw(EOFException) return this->getNextChunk(); } - for(size_t i = 0; i < segments.size(); i++) + if ( segments.size() > this->count ) { - if(i == this->count) - { - this->count++; - Chunk *chunk = new Chunk(); - chunk->setUrl(segments.at(i)->getSourceUrl()); - return chunk; - } + Chunk *chunk = new Chunk; + chunk->setUrl( segments.at( this->count )->getSourceUrl() ); + this->count++; + return chunk; } return NULL; }