]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Move some code. 9265/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 8 Jan 2020 16:37:55 +0000 (09:37 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 8 Jan 2020 16:37:55 +0000 (09:37 -0700)
The previous code was right but unnecessarily hard to read. A block of code could
only be executed if an 'if' condition was true but wasn't actually under the
condition. Shift things.

source/base/data_out_base.cc

index 57248a476b7a93e8fd2282ad0db33c1528470ad5..58524e067c2eb2da913ffb5dbd3c6c1f9383c4bb 100644 (file)
@@ -5229,15 +5229,17 @@ namespace DataOutBase
         ((flags.cycle != std::numeric_limits<unsigned int>::min() ? 1 : 0) +
          (flags.time != std::numeric_limits<double>::min() ? 1 : 0));
       if (n_metadata > 0)
-        out << "FIELD FieldData " << n_metadata << "\n";
-
-      if (flags.cycle != std::numeric_limits<unsigned int>::min())
-        {
-          out << "CYCLE 1 1 int\n" << flags.cycle << "\n";
-        }
-      if (flags.time != std::numeric_limits<double>::min())
         {
-          out << "TIME 1 1 double\n" << flags.time << "\n";
+          out << "FIELD FieldData " << n_metadata << "\n";
+
+          if (flags.cycle != std::numeric_limits<unsigned int>::min())
+            {
+              out << "CYCLE 1 1 int\n" << flags.cycle << "\n";
+            }
+          if (flags.time != std::numeric_limits<double>::min())
+            {
+              out << "TIME 1 1 double\n" << flags.time << "\n";
+            }
         }
     }
 

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.