Skip to content
Snippets Groups Projects
Commit 8a30d6a6 authored by Dmitri Naumov's avatar Dmitri Naumov Committed by Dmitrij Naumov
Browse files

In Element::addNeighbor() remove extra nullptr test.

Check only if there is a neighbor.
parent 60e7b151
No related branches found
No related tags found
No related merge requests found
......@@ -48,14 +48,8 @@ boost::optional<unsigned> Element::addNeighbor(Element* e)
e->getDimension() != this->getDimension())
return boost::optional<unsigned>();
unsigned nNeighbors (this->getNNeighbors());
for (unsigned n=0; n<nNeighbors; n++)
{
if (this->_neighbors[n] == e)
return boost::optional<unsigned>();
if (this->_neighbors[n] == nullptr)
break;
}
if (this->hasNeighbor(e))
return boost::optional<unsigned>();
Node* face_nodes[3];
const unsigned nNodes (this->getNNodes());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment