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

Barun Parrucl barun.parruck at gmail.com
Sat Mar 12 09:27:52 CET 2016


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;
 }
-- 
2.3.2 (Apple Git-55)



More information about the Vlmc-devel mailing list