]> https://gitweb.dealii.org/ - dealii.git/commitdiff
convert for loops 7651/head
authorTimo Heister <timo.heister@gmail.com>
Tue, 29 Jan 2019 19:44:47 +0000 (12:44 -0700)
committerTimo Heister <timo.heister@gmail.com>
Thu, 31 Jan 2019 19:05:12 +0000 (12:05 -0700)
source/grid/grid_in.cc

index c00da148814ea62f04d6e47a1742cff9f58cca49..6a9a6fba532414455b7b5c75b94426f9bc973331 100644 (file)
@@ -2075,8 +2075,8 @@ GridIn<2>::read_netcdf(const std::string &filename)
                           n_bquads,
                           vertices_per_quad);
 
-  for (unsigned int i = 0; i < vertex_indices.size(); ++i)
-    AssertThrow(vertex_indices[i] >= 0, ExcIO());
+  for (const int idx : vertex_indices)
+    AssertThrow(idx >= 0, ExcIO());
 
   // next we read
   //   double points_xc(no_of_points)
@@ -2237,8 +2237,8 @@ GridIn<3>::read_netcdf(const std::string &filename)
   // vector<int>::iterator to int *
   vertex_indices_var->get(&*vertex_indices.begin(), n_cells, vertices_per_hex);
 
-  for (unsigned int i = 0; i < vertex_indices.size(); ++i)
-    AssertThrow(vertex_indices[i] >= 0, ExcIO());
+  for (const int idx : vertex_indices)
+    AssertThrow(idx >= 0, ExcIO());
 
   // next we read
   //   double points_xc(no_of_points)
@@ -2335,9 +2335,9 @@ GridIn<3>::read_netcdf(const std::string &filename)
   // types::boundary_id. Also, we don't
   // take numbers::internal_face_boundary_id
   // as it denotes an internal face
-  for (unsigned int i = 0; i < bmarker.size(); ++i)
-    Assert(0 <= bmarker[i] && static_cast<types::boundary_id>(bmarker[i]) !=
-                                numbers::internal_face_boundary_id,
+  for (const int id : bmarker)
+    Assert(0 <= id && static_cast<types::boundary_id>(id) !=
+                        numbers::internal_face_boundary_id,
            ExcIO());
 
   // finally we setup the boundary

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.