From 274448a0012602f53d9029daf3480d79c5639f86 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Tue, 29 Jan 2019 12:44:47 -0700 Subject: [PATCH] convert for loops --- source/grid/grid_in.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 -- 2.39.5