From 8e8a8a6a11530980389395801e490f108e282aa9 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Tue, 22 Jan 2019 20:36:29 -0600 Subject: [PATCH] DofTools: Use a range-based for loop --- source/dofs/dof_tools_constraints.cc | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/source/dofs/dof_tools_constraints.cc b/source/dofs/dof_tools_constraints.cc index ecbe6ea596..a7af43b0a5 100644 --- a/source/dofs/dof_tools_constraints.cc +++ b/source/dofs/dof_tools_constraints.cc @@ -2449,18 +2449,12 @@ namespace DoFTools const ComponentMask & component_mask, const std::vector &first_vector_components) { - using FaceVector = std::vector< - GridTools::PeriodicFacePair>; - typename FaceVector::const_iterator it, end_periodic; - it = periodic_faces.begin(); - end_periodic = periodic_faces.end(); - // Loop over all periodic faces... - for (; it != end_periodic; ++it) + for (auto &pair : periodic_faces) { using FaceIterator = typename DoFHandlerType::face_iterator; - const FaceIterator face_1 = it->cell[0]->face(it->face_idx[0]); - const FaceIterator face_2 = it->cell[1]->face(it->face_idx[1]); + const FaceIterator face_1 = pair.cell[0]->face(pair.face_idx[0]); + const FaceIterator face_2 = pair.cell[1]->face(pair.face_idx[1]); Assert(face_1->at_boundary() && face_2->at_boundary(), ExcInternalError()); @@ -2473,10 +2467,10 @@ namespace DoFTools face_2, constraints, component_mask, - it->orientation[0], - it->orientation[1], - it->orientation[2], - it->matrix, + pair.orientation[0], + pair.orientation[1], + pair.orientation[2], + pair.matrix, first_vector_components); } } -- 2.39.5