From: Rene Gassmoeller Date: Sun, 21 Aug 2016 03:54:17 +0000 (-0600) Subject: Slight optimization X-Git-Tag: v8.5.0-rc1~750^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2996%2Fhead;p=dealii.git Slight optimization --- diff --git a/source/grid/manifold_lib.cc b/source/grid/manifold_lib.cc index 44cd8b651b..69ace8735f 100644 --- a/source/grid/manifold_lib.cc +++ b/source/grid/manifold_lib.cc @@ -196,7 +196,7 @@ get_intermediate_point (const Point &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(center + w*v2 + (1-w)*v1); // Find the angle gamma described by v1 and v2: @@ -211,7 +211,8 @@ get_intermediate_point (const Point &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.