[Base] remove unnecessary Boolean comparisons

This commit is contained in:
Uwe
2022-06-15 03:55:08 +02:00
parent c23a30b916
commit 6b09da9ab6
5 changed files with 12 additions and 12 deletions

View File

@@ -610,7 +610,7 @@ inline bool BoundBox3<_Precision>::IntersectionPoint (const Vector3<_Precision>
rc = IntersectPlaneWithLine(i, rcVct, rcVctDir, cVctRes);
if (!cCmpBound.IsInBox(cVctRes))
rc = false;
if (rc == true) {
if (rc) {
// does intersection point lie in desired direction
// or was found the opposing side?
// -> scalar product of both direction vectors > 0 (angle < 90)
@@ -773,7 +773,7 @@ inline typename BoundBox3<_Precision>::SIDE BoundBox3<_Precision>::GetSideFromRa
Vector3<_Precision>& rcInt) const
{
Vector3<_Precision> cP0, cP1;
if (IntersectWithLine(rclPt, rclDir, cP0, cP1) == false)
if (!IntersectWithLine(rclPt, rclDir, cP0, cP1))
return INVALID;
Vector3<_Precision> cOut;

View File

@@ -116,7 +116,7 @@ void Builder3D::endPoints()
void Builder3D::addSinglePoint(float x, float y, float z,short pointSize, float color_r,float color_g,float color_b)
{
// addSinglePoint() not between startXXX() and endXXX() allowed
assert( bStartEndOpen == false );
assert(!bStartEndOpen);
result << "Separator { ";
result << "Material { ";
@@ -155,7 +155,7 @@ void Builder3D::addSinglePoint(const Base::Vector3f &vec, short pointSize, float
void Builder3D::addText(float pos_x, float pos_y , float pos_z,const char * text, float color_r,float color_g,float color_b)
{
// addSinglePoint() not between startXXX() and endXXX() allowed
assert( bStartEndOpen == false );
assert(!bStartEndOpen);
result << "Separator { "
<< "Material { diffuseColor " << color_r << " "<< color_g << " "<< color_b << "} "

View File

@@ -556,7 +556,7 @@ bool FileInfo::createDirectories() const
bool FileInfo::deleteDirectory() const
{
if (isDir() == false )
if (!isDir())
return false;
#if defined (FC_OS_WIN32)
std::wstring wstr = toStdWString();
@@ -570,7 +570,7 @@ bool FileInfo::deleteDirectory() const
bool FileInfo::deleteDirectoryRecursive() const
{
if (isDir() == false )
if (!isDir())
return false;
std::vector<Base::FileInfo> List = getDirectoryContent();

View File

@@ -1242,7 +1242,7 @@ BOOL StackWalker::ShowCallstack(HANDLE hThread, const CONTEXT *context, PReadPro
cleanup:
if (pSym) free( pSym );
if (bLastEntryCalled == false)
if (!bLastEntryCalled)
this->OnCallstackEntry(lastEntry, csEntry);
if (context == NULL)

View File

@@ -363,7 +363,7 @@ void Polygon2d::Intersect (const Polygon2d &rclPolygon, std::list<Polygon2d> &rc
bool bInner = Contains(rclPolygon[0]);
Polygon2d clResultPolygon;
if (bInner == true) // add first point if inner trim-polygon
if (bInner) // add first point if inner trim-polygon
clResultPolygon.Add(rclPolygon[0]);
// for each polygon segment
@@ -384,7 +384,7 @@ void Polygon2d::Intersect (const Polygon2d &rclPolygon, std::list<Polygon2d> &rc
Line2d clToTrimLine(At(i), clTrimPt2);
Vector2d clV;
if (clLine.IntersectAndContain(clToTrimLine, clV) == true)
if (clLine.IntersectAndContain(clToTrimLine, clV))
{
// save line parameter of intersection point
double fDist = (clV - clPt0).Length();
@@ -398,7 +398,7 @@ void Polygon2d::Intersect (const Polygon2d &rclPolygon, std::list<Polygon2d> &rc
{
// intersection point
Vector2d clPtIS = clLine.FromPos(*pF);
if (bInner == true)
if (bInner)
{
clResultPolygon.Add(clPtIS);
rclResultPolygonList.push_back(clResultPolygon);
@@ -412,12 +412,12 @@ void Polygon2d::Intersect (const Polygon2d &rclPolygon, std::list<Polygon2d> &rc
}
}
if (bInner == true) // add line end point if inside
if (bInner) // add line end point if inside
clResultPolygon.Add(clPt1);
}
else
{ // no intersections, add line (means second point of it) if inside trim-polygon
if (bInner == true)
if (bInner)
clResultPolygon.Add(clPt1);
}
}