]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Simplify a ?: expression. 14853/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 7 Mar 2023 21:53:09 +0000 (14:53 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 7 Mar 2023 21:53:09 +0000 (14:53 -0700)
examples/step-22/step-22.cc

index aac858b7aca616467073948f6fbdcdbfaf7b002a..93096930d25ad27db14ff4803b8e99155614ac4a 100644 (file)
@@ -202,7 +202,15 @@ namespace Step22
            ExcIndexRange(component, 0, this->n_components));
 
     if (component == 0)
-      return (p[0] < 0 ? -1 : (p[0] > 0 ? 1 : 0));
+      {
+        if (p[0] < 0)
+          return -1;
+        else if (p[0] > 0)
+          return 1;
+        else
+          return 0;
+      }
+
     return 0;
   }
 

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.