mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-05-18 07:57:31 +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:
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user