Commit 29bcf92a authored by Kilian Weishaupt's avatar Kilian Weishaupt Committed by Kilian Weishaupt
Browse files

[boundarytypes] Use std::any_of instead of for loops

parent 2e8c4152
...@@ -255,10 +255,10 @@ public: ...@@ -255,10 +255,10 @@ public:
*/ */
bool hasDirichlet() const bool hasDirichlet() const
{ {
for (int i = 0; i < numEq; ++i) return std::any_of(boundaryInfo_.begin(),
if (boundaryInfo_[i].isDirichlet) boundaryInfo_.end(),
return true; [](const BoundaryInfo& b){ return b.isDirichlet; }
return false; );
} }
/*! /*!
...@@ -288,10 +288,10 @@ public: ...@@ -288,10 +288,10 @@ public:
*/ */
bool hasNeumann() const bool hasNeumann() const
{ {
for (int i = 0; i < numEq; ++i) return std::any_of(boundaryInfo_.begin(),
if (boundaryInfo_[i].isNeumann) boundaryInfo_.end(),
return true; [](const BoundaryInfo& b){ return b.isNeumann; }
return false; );
} }
/*! /*!
...@@ -309,10 +309,10 @@ public: ...@@ -309,10 +309,10 @@ public:
*/ */
bool hasOutflow() const bool hasOutflow() const
{ {
for (int i = 0; i < numEq; ++i) return std::any_of(boundaryInfo_.begin(),
if (boundaryInfo_[i].isOutflow) boundaryInfo_.end(),
return true; [](const BoundaryInfo& b){ return b.isOutflow; }
return false; );
} }
/*! /*!
...@@ -330,10 +330,10 @@ public: ...@@ -330,10 +330,10 @@ public:
*/ */
bool hasCouplingDirichlet() const bool hasCouplingDirichlet() const
{ {
for (int i = 0; i < numEq; ++i) return std::any_of(boundaryInfo_.begin(),
if (boundaryInfo_[i].isCouplingDirichlet) boundaryInfo_.end(),
return true; [](const BoundaryInfo& b){ return b.isCouplingDirichlet; }
return false; );
} }
/*! /*!
...@@ -351,10 +351,10 @@ public: ...@@ -351,10 +351,10 @@ public:
*/ */
bool hasCouplingNeumann() const bool hasCouplingNeumann() const
{ {
for (int i = 0; i < numEq; ++i) return std::any_of(boundaryInfo_.begin(),
if (boundaryInfo_[i].isCouplingNeumann) boundaryInfo_.end(),
return true; [](const BoundaryInfo& b){ return b.isCouplingNeumann; }
return false; );
} }
/*! /*!
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment