]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Get rid of named temporaries for asserts.
authorDavid Wells <drwells@vt.edu>
Sat, 11 Apr 2015 12:47:02 +0000 (08:47 -0400)
committerMatthias Maier <matthias.maier@iwr.uni-heidelberg.de>
Tue, 14 Apr 2015 10:50:19 +0000 (12:50 +0200)
This also avoids writing a lot of (void)s.

source/grid/tria_boundary_lib.cc
source/opencascade/boundary_lib.cc

index 4ad712eccc6239cc8cdcc68edb3f8f7096ebe8fd..a2faeb723a5ac267b760c7de1b7b03105ce1ba44 100644 (file)
@@ -601,10 +601,8 @@ HyperBallBoundary<dim,spacedim>::get_intermediate_points_between_points (
   else
     r = radius;
 
-
-  const double r2=r*r;
-  Assert(std::fabs(v0*v0-r2)<eps*r2, ExcInternalError());
-  Assert(std::fabs(v1*v1-r2)<eps*r2, ExcInternalError());
+  Assert(std::fabs(v0*v0-r*r)<eps*r*r, ExcInternalError());
+  Assert(std::fabs(v1*v1-r*r)<eps*r*r, ExcInternalError());
 
   const double alpha=std::acos((v0*v1)/std::sqrt((v0*v0)*(v1*v1)));
   const Tensor<1,spacedim> pm=0.5*(v0+v1);
index aeebc80e8d61876832998d7bc1fc05621b1f5316..32b0f433dabe277e63703f2d4273bb8ab95c24be 100644 (file)
@@ -119,11 +119,8 @@ namespace OpenCASCADE
     tolerance(tolerance)
   {
     Assert(spacedim == 3, ExcNotImplemented());
-
-    std_cxx11::tuple<unsigned int, unsigned int, unsigned int>
-    counts = count_elements(sh);
-
-    Assert(std_cxx11::get<0>(counts) > 0, ExcMessage("NormalToMeshProjectionBoundary needs a shape containing faces to operate."));
+    Assert(std_cxx11::get<0>(count_elements(sh)) > 0,
+           ExcMessage("NormalToMeshProjectionBoundary needs a shape containing faces to operate."));
   }
 
 

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.