]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Reuse a variable already defined, rather than recompute the value.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 12 Jun 2015 00:53:19 +0000 (19:53 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 12 Jun 2015 02:31:12 +0000 (21:31 -0500)
source/dofs/dof_renumbering.cc

index dbabbd6c3d1e272f2b43a933a653459e46c132bb..d197d5178afe98aa91c6cbb97db8aba85ac9f2f7 100644 (file)
@@ -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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.