From: Timo Heister Date: Tue, 29 Jan 2019 19:44:47 +0000 (-0700) Subject: convert for loops X-Git-Tag: v9.1.0-rc1~384^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7651%2Fhead;p=dealii.git convert for loops --- diff --git a/source/grid/grid_in.cc b/source/grid/grid_in.cc index c00da14881..6a9a6fba53 100644 --- a/source/grid/grid_in.cc +++ b/source/grid/grid_in.cc @@ -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::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(bmarker[i]) != - numbers::internal_face_boundary_id, + for (const int id : bmarker) + Assert(0 <= id && static_cast(id) != + numbers::internal_face_boundary_id, ExcIO()); // finally we setup the boundary