diff --git a/source/blender/blenlib/intern/convexhull_2d.cc b/source/blender/blenlib/intern/convexhull_2d.cc index 13e8fe2abf7..9f00245cd5a 100644 --- a/source/blender/blenlib/intern/convexhull_2d.cc +++ b/source/blender/blenlib/intern/convexhull_2d.cc @@ -232,6 +232,7 @@ int BLI_convexhull_2d(const float (*points)[2], const int points_num, int r_poin /** \name Comupte AABB Fitting Angle (For Assertion) * \{ */ +#if defined(USE_BRUTE_FORCE_ASSERT) && !defined(NDEBUG) static float convexhull_aabb_fit_hull_2d_brute_force(const float (*points_hull)[2], int points_hull_num) { @@ -275,6 +276,7 @@ static float convexhull_aabb_fit_hull_2d_brute_force(const float (*points_hull)[ return (area_best != FLT_MAX) ? float(atan2(sincos_best[0], sincos_best[1])) : 0.0f; } +#endif /** \} */ @@ -401,16 +403,13 @@ static float convexhull_aabb_fit_hull_2d(const float (*points_hull)[2], int poin const float angle = (area_best != FLT_MAX) ? float(atan2(sincos_best[0], sincos_best[1])) : 0.0f; -#ifdef USE_BRUTE_FORCE_ASSERT - if (true) -#else - if (false) -#endif +#if defined(USE_BRUTE_FORCE_ASSERT) && !defined(NDEBUG) { /* Ensure the optimized result matches the brute-force version. */ const float angle_test = convexhull_aabb_fit_hull_2d_brute_force(points_hull, points_hull_num); BLI_assert(angle == angle_test); } +#endif return angle; }