[Merge] lp:~phablet-team/qtubuntu-media/tweak-add-media-performance into lp:qtubuntu-media/stable

Alfonso Sanchez-Beato alfonso.sanchez-beato at canonical.com
Fri Oct 23 11:05:45 UTC 2015


Review: Needs Fixing

LGTM, just a minor nit.

Diff comments:

> 
> === modified file 'src/aal/aalmediaplaylistprovider.cpp'
> --- src/aal/aalmediaplaylistprovider.cpp	2015-08-18 15:48:31 +0000
> +++ src/aal/aalmediaplaylistprovider.cpp	2015-10-22 22:54:23 +0000
> @@ -310,12 +327,20 @@
>      return true;
>  }
>  
> -int AalMediaPlaylistProvider::indexOfTrack(const media::Track::Id &id) const
> +int AalMediaPlaylistProvider::indexOfTrack(const media::Track::Id &id, bool reverse) const
>  {
>      if (id.empty() || track_index_lut.size() == 0)
>          return -1;
>  
> -    const auto trackPos = std::find(track_index_lut.begin(), track_index_lut.end(), id);
> +    std::vector<media::Track::Id>::const_iterator trackPos;
> +    if (not reverse)
> +        trackPos = std::find(track_index_lut.begin(), track_index_lut.end(), id);
> +    else

Please add braces to the if part of the clause so it is symmetrical to the else part.

> +    {
> +        const std::vector<media::Track::Id> searchTerm = {id};
> +        trackPos = std::find_end(track_index_lut.begin(), track_index_lut.end(), searchTerm.begin(), searchTerm.end());
> +    }
> +
>      if (trackPos == track_index_lut.end())
>      {
>          qWarning() << "Failed to look up index for non-existent track id: " << id.c_str();


-- 
https://code.launchpad.net/~phablet-team/qtubuntu-media/tweak-add-media-performance/+merge/275427
Your team Ubuntu Phablet Team is subscribed to branch lp:qtubuntu-media/stable.



More information about the Ubuntu-reviews mailing list