From 7e62845a64f96393c272ecfb7758e79a249fe9ac Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 22 Mar 2022 16:44:26 -0600 Subject: [PATCH] Simplify a piece of code. --- source/dofs/dof_renumbering.cc | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/source/dofs/dof_renumbering.cc b/source/dofs/dof_renumbering.cc index d4c31794ff..1c31ae74f9 100644 --- a/source/dofs/dof_renumbering.cc +++ b/source/dofs/dof_renumbering.cc @@ -967,22 +967,18 @@ namespace DoFRenumbering for (unsigned int component = 0; component < fe_collection.n_components(); ++component) { - const typename std::vector::const_iterator - begin_of_component = component_to_dof_map[component].begin(), - end_of_component = component_to_dof_map[component].end(); - next_free_index = shifts[component]; - for (typename std::vector::const_iterator - dof_index = begin_of_component; - dof_index != end_of_component; - ++dof_index) + for (const types::global_dof_index dof_index : + component_to_dof_map[component]) { - Assert(locally_owned_dofs.index_within_set(*dof_index) < + Assert(locally_owned_dofs.index_within_set(dof_index) < new_indices.size(), ExcInternalError()); - new_indices[locally_owned_dofs.index_within_set(*dof_index)] = - next_free_index++; + new_indices[locally_owned_dofs.index_within_set(dof_index)] = + next_free_index; + + ++next_free_index; } } -- 2.39.5