From 6af03f145631d1b1661ef52651996cb842d2b2e4 Mon Sep 17 00:00:00 2001 From: Eisuke Kawashima Date: Thu, 21 Nov 2019 21:30:24 +0900 Subject: [PATCH] Check if a vector can be normalized (fix #2088) --- src/math/vector3.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/math/vector3.cpp b/src/math/vector3.cpp index e9ca70d1f7..bf02b76663 100644 --- a/src/math/vector3.cpp +++ b/src/math/vector3.cpp @@ -151,13 +151,9 @@ namespace OpenBabel */ vector3& vector3 :: normalize () { -#ifdef OB_OLD_MATH_CHECKS - if( CanBeNormalized() ) - (*this) /= length(); -#else - (*this) /= length(); -#endif - return(*this); + if (CanBeNormalized()) + *this /= length(); + return *this; } OBAPI vector3 cross ( const vector3& v1, const vector3& v2 )