From 30243734a86a27487e4bded8a978a5d2e2cc4a01 Mon Sep 17 00:00:00 2001 From: Thomas Fischer <thomas.fischer@ufz.de> Date: Wed, 24 Sep 2014 09:53:01 +0200 Subject: [PATCH] [MGT] Remove unnecessary check. --- MeshGeoToolsLib/HeuristicSearchLength.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/MeshGeoToolsLib/HeuristicSearchLength.cpp b/MeshGeoToolsLib/HeuristicSearchLength.cpp index 3a19fc002bc..047ee3b1045 100644 --- a/MeshGeoToolsLib/HeuristicSearchLength.cpp +++ b/MeshGeoToolsLib/HeuristicSearchLength.cpp @@ -33,15 +33,10 @@ HeuristicSearchLength::HeuristicSearchLength(MeshLib::Mesh const& mesh) it != elements.cend(); ++it) { std::size_t const n_edges((*it)->getNEdges()); for (std::size_t k(0); k<n_edges; k++) { - MeshLib::Line const* edge(static_cast<MeshLib::Line const*>((*it)->getEdge(k))); - if (!edge) { - delete edge; - continue; - } - double const len(edge->getLength()); + double const len = + static_cast<MeshLib::Line const*>((*it)->getEdge(k))->getLength(); sum += len; sum_of_sqr += len*len; - delete edge; } edge_cnt += n_edges; } -- GitLab