From ab0aaa8070700c7178f766499cb3e31c56c4cf8f Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 26 Sep 2017 15:23:25 -0600 Subject: [PATCH] Reorder statements to avoid some computations when not necessary. --- source/dofs/dof_tools_constraints.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source/dofs/dof_tools_constraints.cc b/source/dofs/dof_tools_constraints.cc index c443e69afa..5ad1272734 100644 --- a/source/dofs/dof_tools_constraints.cc +++ b/source/dofs/dof_tools_constraints.cc @@ -1476,14 +1476,15 @@ namespace DoFTools cell->face(face)->get_dof_indices (master_dofs, cell->active_fe_index ()); - slave_dofs.resize (neighbor->get_fe().dofs_per_face); - cell->face(face)->get_dof_indices (slave_dofs, - neighbor->active_fe_index ()); - // break if the n_master_dofs == 0, because we are // attempting to constrain to an element that has // no face dofs - if (master_dofs.size() == 0) break; + if (master_dofs.size() == 0) + break; + + slave_dofs.resize (neighbor->get_fe().dofs_per_face); + cell->face(face)->get_dof_indices (slave_dofs, + neighbor->active_fe_index ()); // make sure the element constraints for this face // are available -- 2.39.5