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

@@ -67,11 +67,7 @@ bool Expr_ArcCosine::IsIdentical(const occ::handle<Expr_GeneralExpression>& Othe
bool Expr_ArcCosine::IsLinear() const
{
if (ContainsUnknowns())
{
return false;
}
return true;
return !ContainsUnknowns();
}
occ::handle<Expr_GeneralExpression> Expr_ArcCosine::Derivative(

View File

@@ -65,11 +65,7 @@ bool Expr_ArcSine::IsIdentical(const occ::handle<Expr_GeneralExpression>& Other)
bool Expr_ArcSine::IsLinear() const
{
if (ContainsUnknowns())
{
return false;
}
return true;
return !ContainsUnknowns();
}
occ::handle<Expr_GeneralExpression> Expr_ArcSine::Derivative(

View File

@@ -65,11 +65,7 @@ bool Expr_ArcTangent::IsIdentical(const occ::handle<Expr_GeneralExpression>& Oth
bool Expr_ArcTangent::IsLinear() const
{
if (ContainsUnknowns())
{
return false;
}
return true;
return !ContainsUnknowns();
}
occ::handle<Expr_GeneralExpression> Expr_ArcTangent::Derivative(

View File

@@ -65,11 +65,7 @@ bool Expr_ArgCosh::IsIdentical(const occ::handle<Expr_GeneralExpression>& Other)
bool Expr_ArgCosh::IsLinear() const
{
if (ContainsUnknowns())
{
return false;
}
return true;
return !ContainsUnknowns();
}
occ::handle<Expr_GeneralExpression> Expr_ArgCosh::Derivative(

View File

@@ -66,11 +66,7 @@ bool Expr_ArgSinh::IsIdentical(const occ::handle<Expr_GeneralExpression>& Other)
bool Expr_ArgSinh::IsLinear() const
{
if (ContainsUnknowns())
{
return false;
}
return true;
return !ContainsUnknowns();
}
occ::handle<Expr_GeneralExpression> Expr_ArgSinh::Derivative(

View File

@@ -64,11 +64,7 @@ bool Expr_ArgTanh::IsIdentical(const occ::handle<Expr_GeneralExpression>& Other)
bool Expr_ArgTanh::IsLinear() const
{
if (ContainsUnknowns())
{
return false;
}
return true;
return !ContainsUnknowns();
}
occ::handle<Expr_GeneralExpression> Expr_ArgTanh::Derivative(

View File

@@ -111,11 +111,7 @@ bool Expr_NamedFunction::IsIdentical(const occ::handle<Expr_GeneralFunction>& fu
return false;
}
}
if (!Expression()->IsIdentical(occ::down_cast<Expr_NamedFunction>(func)->Expression()))
{
return false;
}
return true;
return Expression()->IsIdentical(occ::down_cast<Expr_NamedFunction>(func)->Expression());
}
bool Expr_NamedFunction::IsLinearOnVariable(const int) const