瀏覽代碼

ENH: Use foreach instead of for(...)

Xavi Planes 14 年之前
父節點
當前提交
a7b686fc84
共有 2 個文件被更改,包括 4 次插入12 次删除
  1. 2 6
      Libs/ModuleDescription/ctkModuleDescription.cpp
  2. 2 6
      Libs/ModuleDescription/ctkModuleParameterGroup.cpp

+ 2 - 6
Libs/ModuleDescription/ctkModuleDescription.cpp

@@ -51,12 +51,8 @@ QTextStream & operator<<(QTextStream &os, const ctkModuleDescription &module)
   //os << "Logo: " << module.GetLogo() << endl;
 
   os << "ParameterGroups: " << endl;
-  QVector<ctkModuleParameterGroup>::const_iterator it = module.parameterGroups().begin();
-  while (it != module.parameterGroups().end())
-    {
-    os << *it;
-    ++it;
-    }
+  foreach( const ctkModuleParameterGroup& it, module.parameterGroups())
+  { os << it; }
   return os;
 }
 

+ 2 - 6
Libs/ModuleDescription/ctkModuleParameterGroup.cpp

@@ -55,11 +55,7 @@ QTextStream & operator<<(QTextStream &os, const ctkModuleParameterGroup &group)
   os << QHash<QString, QString>(group);
 
   os << "  Parameters: " << endl;
-  QVector<ctkModuleParameter>::const_iterator it = group.parameters().begin();
-  while (it != group.parameters().end())
-    {
-    os << *it;
-    ++it;
-    }
+  foreach( const ctkModuleParameter& it, group.parameters())
+  { os << it; }
   return os;
 }