]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Slight optimization 2996/head
authorRene Gassmoeller <rene.gassmoeller@mailbox.org>
Sun, 21 Aug 2016 03:54:17 +0000 (21:54 -0600)
committerRene Gassmoeller <rene.gassmoeller@mailbox.org>
Mon, 22 Aug 2016 19:24:58 +0000 (13:24 -0600)
source/grid/manifold_lib.cc

index 44cd8b651b53be925bddf80246b5361ed869c1c5..69ace8735f13f5c0f03a77c5a4cb3eb4768d3c55 100644 (file)
@@ -196,7 +196,7 @@ get_intermediate_point (const Point<spacedim> &p1,
   const Tensor<1,spacedim> e1 = v1/r1;
   const Tensor<1,spacedim> e2 = v2/r2;
 
-  if ((e1 - e2).norm() < tol)
+  if ((e1 - e2).norm_square() < tol*tol)
     return Point<spacedim>(center + w*v2 + (1-w)*v1);
 
   // Find the angle gamma described by v1 and v2:
@@ -211,7 +211,8 @@ get_intermediate_point (const Point<spacedim> &p1,
   Assert( n.norm() > 0,
           ExcInternalError("n should be different from the null vector."
                            "Probably this means v1==v2 or v2==0."));
-  n = n/n.norm();
+
+  n /= n.norm();
 
   // Find the point Q along O,v1 such that
   // P1,V,P2 has measure sigma.

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.