]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Push a variable declaration down to its first use. 16409/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 2 Jan 2024 21:43:54 +0000 (14:43 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 2 Jan 2024 21:43:54 +0000 (14:43 -0700)
source/lac/trilinos_sparsity_pattern.cc

index ccf17e785fd241c6f7437bfffa39fd4eaf14d8fc..b2b83a6acc3e16151d9073d41275243c4c625f3f 100644 (file)
@@ -895,8 +895,7 @@ namespace TrilinosWrappers
   SparsityPattern::size_type
   SparsityPattern::bandwidth() const
   {
-    size_type                         local_b  = 0;
-    TrilinosWrappers::types::int_type global_b = 0;
+    size_type local_b = 0;
     for (int i = 0; i < static_cast<int>(local_size()); ++i)
       {
         int *indices;
@@ -909,6 +908,8 @@ namespace TrilinosWrappers
               local_b = std::abs(i - indices[j]);
           }
       }
+
+    TrilinosWrappers::types::int_type global_b = 0;
     graph->Comm().MaxAll(reinterpret_cast<TrilinosWrappers::types::int_type *>(
                            &local_b),
                          &global_b,

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.