From: Wolfgang Bangerth Date: Fri, 12 Jun 2015 00:53:19 +0000 (-0500) Subject: Reuse a variable already defined, rather than recompute the value. X-Git-Tag: v8.3.0-rc1~120^2~3 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33f8063545d0b205b31c7ad0cb12ed3b44c863c4;p=dealii.git Reuse a variable already defined, rather than recompute the value. --- diff --git a/source/dofs/dof_renumbering.cc b/source/dofs/dof_renumbering.cc index dbabbd6c3d..d197d5178a 100644 --- a/source/dofs/dof_renumbering.cc +++ b/source/dofs/dof_renumbering.cc @@ -398,12 +398,12 @@ namespace DoFRenumbering DoFTools::make_hanging_node_constraints (dof_handler, constraints); constraints.close (); - IndexSet locally_owned = dof_handler.locally_owned_dofs(); + const IndexSet locally_owned = dof_handler.locally_owned_dofs(); // otherwise compute the Cuthill-McKee permutation DynamicSparsityPattern dsp (dof_handler.n_dofs(), dof_handler.n_dofs(), - dof_handler.locally_owned_dofs()); + locally_owned); DoFTools::make_sparsity_pattern (dof_handler, dsp, constraints); // constraints are not needed anymore @@ -411,8 +411,8 @@ namespace DoFRenumbering // If the index set is not complete, need to get indices in local index // space. - if (dof_handler.locally_owned_dofs().n_elements() != - dof_handler.locally_owned_dofs().size()) + if (locally_owned.n_elements() != + locally_owned.size()) { // Create sparsity pattern from dsp by transferring its indices to // processor-local index space and doing Cuthill-McKee there