From 5f52bd7b46ffddc36685ede012a86f29dd6e561d Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 13 Mar 2019 13:49:04 +0100 Subject: [PATCH] PVS: V728 An excessive check can be simplified --- src/Mod/Fem/App/FemConstraintPulley.cpp | 2 +- src/Mod/Sketcher/App/SketchObject.cpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Mod/Fem/App/FemConstraintPulley.cpp b/src/Mod/Fem/App/FemConstraintPulley.cpp index 72dbc7aa70..b71e6cf19c 100644 --- a/src/Mod/Fem/App/FemConstraintPulley.cpp +++ b/src/Mod/Fem/App/FemConstraintPulley.cpp @@ -86,7 +86,7 @@ void ConstraintPulley::onChanged(const App::Property* prop) if (neg) force *= -1.0; - if ((IsDriven.getValue() && neg) || (!IsDriven.getValue() && !neg)) { + if (IsDriven.getValue() == neg) { BeltForce1.setValue(force + TensionForce.getValue()); BeltForce2.setValue(TensionForce.getValue()); } else { diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 15b1df6d81..605defff15 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -4726,20 +4726,20 @@ int SketchObject::deleteUnusedInternalGeometry(int GeoId, bool delgeoid) } } - if ( (f && !s) || (!f && s) ) { // the equality constraint constraints a pole but it is not interpole + if (f != s) { // the equality constraint constraints a pole but it is not interpole (*ita)++; } } - // ignore radiuses and diameters - else if (((*itc)->Type!=Sketcher::Radius && (*itc)->Type!=Sketcher::Diameter) && ( (*itc)->Second == (*it) || (*itc)->First == (*it) || (*itc)->Third == (*it)) ) + // ignore radii and diameters + else if (((*itc)->Type!=Sketcher::Radius && (*itc)->Type!=Sketcher::Diameter) && ( (*itc)->Second == (*it) || (*itc)->First == (*it) || (*itc)->Third == (*it)) ) { (*ita)++; + } + } - } - - if ( (*ita) < 2 ) { // IA - delgeometries.push_back((*it)); - } + if ( (*ita) < 2 ) { // IA + delgeometries.push_back((*it)); + } } }