From 510ba46208311e13de3606d8f924c860d71c9028 Mon Sep 17 00:00:00 2001 From: Norihiro Watanabe Date: Thu, 3 Nov 2016 13:42:29 +0100 Subject: [PATCH] [Mesh] use any_of in hasNonlinearElement() --- MeshLib/Mesh.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/MeshLib/Mesh.cpp b/MeshLib/Mesh.cpp index 76f51fe4d20..771663394b8 100644 --- a/MeshLib/Mesh.cpp +++ b/MeshLib/Mesh.cpp @@ -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,