]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Slightly clean up code, making the life of return-value optimizations simpler
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 18 Jul 2005 17:05:56 +0000 (17:05 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 18 Jul 2005 17:05:56 +0000 (17:05 +0000)
by having only a single return statement.

git-svn-id: https://svn.dealii.org/trunk@11161 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/tensor.h

index 3d57c48719523707a975fa63654f5627b960cb1f..a8df8cc73027ecd29d3eb677acf8afe451cb4212 100644 (file)
@@ -1277,7 +1277,8 @@ invert (const Tensor<2,dim> &t)
     {
       case 1:
            return_tensor[0][0] = 1.0/t[0][0];
-           return return_tensor;
+           break;
+
       case 2:
                                             // this is Maple output,
                                             // thus a bit unstructured
@@ -1287,8 +1288,8 @@ invert (const Tensor<2,dim> &t)
        return_tensor[0][1] = -t[0][1]*t4;
        return_tensor[1][0] = -t[1][0]*t4;
        return_tensor[1][1] = t[0][0]*t4;
-       return return_tensor;
-      };
+       break;
+      }
       
       case 3:
       {
@@ -1309,8 +1310,9 @@ invert (const Tensor<2,dim> &t)
        return_tensor[2][0] = -(-t[1][0]*t[2][1]+t[1][1]*t[2][0])*t07;
        return_tensor[2][1] = -(t[0][0]*t[2][1]-t01)*t07;
        return_tensor[2][2] = (t4-t8)*t07;
-       return return_tensor;
-      };
+        
+       break;
+      }
 
                                        // if desired, take over the
                                        // inversion of a 4x4 tensor
@@ -1318,7 +1320,7 @@ invert (const Tensor<2,dim> &t)
        
       default:
            AssertThrow (false, ExcNotImplemented());
-    };    
+    }    
   return return_tensor;
 }
 

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.