mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-09-05 12:17:50 +08:00
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:
@@ -23,7 +23,6 @@ IMPLEMENT_STANDARD_RTTIEXT(NCollection_AlignedAllocator, NCollection_BaseAllocat
|
||||
NCollection_AlignedAllocator::NCollection_AlignedAllocator(const size_t theAlignment) noexcept
|
||||
: myAlignment(theAlignment)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -33,9 +33,9 @@ NCollection_BasePointerVector::NCollection_BasePointerVector(
|
||||
|
||||
NCollection_BasePointerVector::NCollection_BasePointerVector(
|
||||
NCollection_BasePointerVector&& theOther) noexcept
|
||||
: mySize(std::move(theOther.mySize)),
|
||||
myCapacity(std::move(theOther.myCapacity)),
|
||||
myArray(std::move(theOther.myArray))
|
||||
: mySize(theOther.mySize),
|
||||
myCapacity(theOther.myCapacity),
|
||||
myArray(theOther.myArray)
|
||||
{
|
||||
theOther.myCapacity = 0;
|
||||
theOther.mySize = 0;
|
||||
@@ -128,9 +128,9 @@ NCollection_BasePointerVector& NCollection_BasePointerVector::operator=(
|
||||
return *this;
|
||||
}
|
||||
clear();
|
||||
mySize = std::move(theOther.mySize);
|
||||
myCapacity = std::move(theOther.myCapacity);
|
||||
myArray = std::move(theOther.myArray);
|
||||
mySize = theOther.mySize;
|
||||
myCapacity = theOther.myCapacity;
|
||||
myArray = theOther.myArray;
|
||||
theOther.myCapacity = 0;
|
||||
theOther.mySize = 0;
|
||||
theOther.myArray = nullptr;
|
||||
|
||||
@@ -410,11 +410,7 @@ public:
|
||||
bool Contains(const TheKeyType& theKey1) const
|
||||
{
|
||||
IndexedDataMapNode* aNode;
|
||||
if (lookup(theKey1, aNode))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return static_cast<bool>(lookup(theKey1, aNode));
|
||||
}
|
||||
|
||||
//! Substitute
|
||||
|
||||
@@ -242,7 +242,7 @@ bool NCollection_SparseArrayBase::HasValue(const size_t theIndex) const
|
||||
size_t iBlock = theIndex / myBlockSize;
|
||||
if (iBlock >= myNbBlocks || !myData[iBlock])
|
||||
return false;
|
||||
return getBlock(myData[iBlock]).IsSet(theIndex % myBlockSize) ? true : false;
|
||||
return getBlock(myData[iBlock]).IsSet(theIndex % myBlockSize) != 0;
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -318,7 +318,7 @@ public:
|
||||
this->myAlloc->Free(myRoot);
|
||||
myRoot = nullptr;
|
||||
}
|
||||
if (aNewAlloc.IsNull() == false)
|
||||
if (!aNewAlloc.IsNull())
|
||||
myAlloc = aNewAlloc;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,6 @@ inline NCollection_UtfString<Type>::NCollection_UtfString()
|
||||
mySize(0),
|
||||
myLength(0)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
Reference in New Issue
Block a user