[vlmc-devel] [PATCH] C++ 11 style change

Hugo Beauzée-Luyssen hugo at beauzee.fr
Mon Mar 14 21:07:08 CET 2016


On 03/12/2016 09:27 AM, Barun Parrucl wrote:
> From: Barun Parruck <barun.parruck at gmail.com>
> 
> Changed a function to use a ranged based for loop to be more compliant with C++ 11 styling.
> ---
>  src/Settings/Settings.cpp | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/src/Settings/Settings.cpp b/src/Settings/Settings.cpp
> index c1f97ad..a6635c2 100644
> --- a/src/Settings/Settings.cpp
> +++ b/src/Settings/Settings.cpp
> @@ -201,15 +201,13 @@ Settings::SettingList
>  Settings::group(const QString &groupName) const
>  {
>      QReadLocker lock( &m_rwLock );
> -    SettingMap::const_iterator          it = m_settings.begin();
> -    SettingMap::const_iterator          ed = m_settings.end();
>      SettingList        ret;
>  
>      QString grp = groupName + '/';
> -    for ( ; it != ed; ++it )
> +    for ( auto s : m_settings )
>      {
> -        if ( (*it)->key().startsWith( grp ) )
> -            ret.push_back( *it );
> +        if ( s->key().startsWith( grp ) )
> +            ret.push_back( s );
>      }
>      return ret;
>  }
> 
Applied, thanks!

-- 
Hugo Beauzée-Luyssen
www.beauzee.fr


More information about the Vlmc-devel mailing list