Coding - Apply more flags from Clang-tidy (#977)

- Refactor boolean expressions and improve code readability across multiple files
- Simplified boolean expressions by removing unnecessary comparisons to true/false.
- Replaced explicit boolean checks with direct variable usage 

Used flags:
readability-static-accessed-through-instance
readability-simplify-boolean-expr
performance-for-range-copy
performance-move-const-arg
misc-unused-parameters
misc-redundant-expression
This commit is contained in:
Pasukhin Dmitry
2026-01-03 12:18:59 +00:00
committed by GitHub
parent 825b0bd782
commit 6c24544fe1
582 changed files with 1535 additions and 3246 deletions

View File

@@ -84,7 +84,7 @@ void BRepMesh_CurveTessellator::init()
if (myParameters.AdjustMinSize)
{
aMinSize = std::min(aMinSize,
myParameters.RelMinSize()
IMeshTools_Parameters::RelMinSize()
* GCPnts_AbscissaPoint::Length(myCurve,
myCurve.FirstParameter(),
myCurve.LastParameter(),

View File

@@ -1541,10 +1541,7 @@ bool BRepMesh_Delaun::isVertexInsidePolygon(
aPrevVertexDir = aCurVertexDir;
}
if (std::abs(std::abs(aTotalAng) - Angle2PI) > Precision::Angular())
return false;
return true;
return std::abs(std::abs(aTotalAng) - Angle2PI) <= Precision::Angular();
}
//=======================================================================

View File

@@ -82,7 +82,7 @@ bool BRepMesh_FaceDiscret::performInternal(const occ::handle<IMeshData_Model>& t
OSD_Parallel::For(0,
myModel->FacesNb(),
aFunctor,
!(myParameters.InParallel && myModel->FacesNb() > 1));
!myParameters.InParallel || myModel->FacesNb() <= 1);
if (!theRange.More())
{
return false;

View File

@@ -186,7 +186,7 @@ void BRepMesh_ModelHealer::amplifyEdges()
OSD_Parallel::ForEach(aEdgesToUpdate.cbegin(),
aEdgesToUpdate.cend(),
anEdgeAmplifier,
!(myParameters.InParallel && aEdgesToUpdate.Size() > 1),
!myParameters.InParallel || aEdgesToUpdate.Size() <= 1,
aEdgesToUpdate.Size());
IMeshData::MapOfIFacePtr aFacesToCheck(1, aTmpAlloc);
@@ -203,7 +203,7 @@ void BRepMesh_ModelHealer::amplifyEdges()
OSD_Parallel::ForEach(aFacesToCheck.cbegin(),
aFacesToCheck.cend(),
*this,
!(myParameters.InParallel && aFacesToCheck.Size() > 1),
!myParameters.InParallel || aFacesToCheck.Size() <= 1,
aFacesToCheck.Size());
aEdgesToUpdate.Clear();

View File

@@ -301,8 +301,8 @@ void BRepMesh_NURBSRangeSplitter::AdjustRange()
const std::pair<double, double>& aRangeU = GetRangeU();
const std::pair<double, double>& aRangeV = GetRangeV();
myIsValid = !(aRangeU.first < -0.5 || aRangeU.second > 1.5 || aRangeV.first < -0.5
|| aRangeV.second > 1.5);
myIsValid = aRangeU.first >= -0.5 && aRangeU.second <= 1.5 && aRangeV.first >= -0.5
&& aRangeV.second <= 1.5;
}
}