Skip to content

Commit

Permalink
[Mesh] use any_of in hasNonlinearElement()
Browse files Browse the repository at this point in the history
  • Loading branch information
Norihiro Watanabe committed Nov 7, 2016
1 parent 67bcfa2 commit 510ba46
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions MeshLib/Mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,10 @@ void Mesh::checkNonlinearNodeIDs() const

bool Mesh::hasNonlinearElement() const
{
for (auto* const e : _elements)
{
if (e->getNumberOfNodes() == e->getNumberOfBaseNodes())
continue;
return true;
}
return false;
return std::any_of(std::begin(_elements), std::end(_elements),
[](Element const* const e) {
return e->getNumberOfNodes() != e->getNumberOfBaseNodes();
});
}

void scaleMeshPropertyVector(MeshLib::Mesh & mesh,
Expand Down

0 comments on commit 510ba46

Please sign in to comment.