[Bf-blender-cvs] [6fe3bbed343] master: Cleanup: restore text alignment lost by clang-format

Campbell Barton noreply at git.blender.org
Wed May 6 08:01:44 CEST 2020


Commit: 6fe3bbed3438e6dc4f4cf3e45b4c0628b8f70bc9
Author: Campbell Barton
Date:   Wed May 6 15:38:32 2020 +1000
Branches: master
https://developer.blender.org/rB6fe3bbed3438e6dc4f4cf3e45b4c0628b8f70bc9

Cleanup: restore text alignment lost by clang-format

===================================================================

M	source/blender/blenlib/intern/quadric.c

===================================================================

diff --git a/source/blender/blenlib/intern/quadric.c b/source/blender/blenlib/intern/quadric.c
index 0a1ff9f8116..fc238966651 100644
--- a/source/blender/blenlib/intern/quadric.c
+++ b/source/blender/blenlib/intern/quadric.c
@@ -141,9 +141,14 @@ void BLI_quadric_mul(Quadric *a, const double scalar)
 
 double BLI_quadric_evaluate(const Quadric *q, const double v[3])
 {
-  return ((q->a2 * v[0] * v[0]) + (q->ab * 2 * v[0] * v[1]) + (q->ac * 2 * v[0] * v[2]) +
-          (q->ad * 2 * v[0]) + (q->b2 * v[1] * v[1]) + (q->bc * 2 * v[1] * v[2]) +
-          (q->bd * 2 * v[1]) + (q->c2 * v[2] * v[2]) + (q->cd * 2 * v[2]) + (q->d2));
+  const double v00 = v[0] * v[0], v01 = v[0] * v[1], v02 = v[0] * v[2];
+  const double v11 = v[1] * v[1], v12 = v[1] * v[2];
+  const double v22 = v[1] * v[2];
+  return ((q->a2 * v00) + (q->ab * 2 * v01) + (q->ac * 2 * v02) + (q->ad * 2 * v[0]) + /* a */
+          (q->b2 * v11) + (q->bc * 2 * v12) + (q->bd * 2 * v[1]) +                     /* b */
+          (q->c2 * v22) + (q->cd * 2 * v[2]) +                                         /* c */
+          (q->d2)                                                                      /* d */
+  );
 }
 
 bool BLI_quadric_optimize(const Quadric *q, double v[3], const double epsilon)



More information about the Bf-blender-cvs mailing list