From f2fd3809c599279fcf65bd6286f02e77a91932eb Mon Sep 17 00:00:00 2001 From: ika Date: Thu, 15 Nov 2012 15:14:58 +0400 Subject: [PATCH] 0023291: GccAna_Circ2d3Tan_8.cxx, suspicious if one of the duplicate conditions has been removed Code was changed to be more obvious. Unite if blocks into one block Small correction of coding style --- src/GccAna/GccAna_Circ2d3Tan_8.cxx | 32 ++++++++++-------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/src/GccAna/GccAna_Circ2d3Tan_8.cxx b/src/GccAna/GccAna_Circ2d3Tan_8.cxx index 0cfe59d6c9..3253a829d9 100755 --- a/src/GccAna/GccAna_Circ2d3Tan_8.cxx +++ b/src/GccAna/GccAna_Circ2d3Tan_8.cxx @@ -118,29 +118,17 @@ GccAna_Circ2d3Tan:: // Standard_Integer nbsol2 = 0; Standard_Integer nbsol3 = 0; Standard_Boolean ok = Standard_False; - if (Qualified1.IsEnclosed()) { - if ((((origin1.X()-Center.X())*(-dir1.Y()))+ - ((origin1.Y()-Center.Y())*(dir1.X())))<=0){ - ok = Standard_True; - nbsol1 = 1; - Radius = dist1; - } - } - else if (Qualified1.IsOutside()) { - if ((((origin1.X()-Center.X())*(-dir1.Y()))+ - ((origin1.Y()-Center.Y())*(dir1.X())))>=0){ - ok = Standard_True; - nbsol1 = 1; - Radius = dist1; - } - } - else if (Qualified1.IsUnqualified()) { - ok = Standard_True; - nbsol1 = 1; - Radius = dist1; - } + Standard_Real difference = (((origin1.X()-Center.X())*(-dir1.Y())) + ((origin1.Y()-Center.Y())*(dir1.X()))); + if ((Qualified1.IsEnclosed() && difference <= 0) || + (Qualified1.IsOutside() && difference >= 0) || + (Qualified1.IsUnqualified())) + { + ok = Standard_True; + nbsol1 = 1; + Radius = dist1; + } if (ok) { - if (Abs(dist2-Radius)<=Tol && Abs(dist2-Radius)<=Tol) { + if (Abs(dist2-Radius)<=Tol) { nbsol3 = 1; } else { ok = Standard_False; }