From: Wolfgang Bangerth Date: Tue, 26 Sep 2017 21:23:25 +0000 (-0600) Subject: Reorder statements to avoid some computations when not necessary. X-Git-Tag: v9.0.0-rc1~1016^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab0aaa8070700c7178f766499cb3e31c56c4cf8f;p=dealii.git Reorder statements to avoid some computations when not necessary. --- 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