Skip to content
Snippets Groups Projects
Commit fd0e7605 authored by Tom Fischer's avatar Tom Fischer Committed by Dmitri Naumov
Browse files

[MeL] Element::addNeighbor: Avoid to fetch the dimension twice.

parent 44433928
No related branches found
No related tags found
No related merge requests found
......@@ -41,7 +41,8 @@ void Element::setNeighbor(Element* neighbor, unsigned const face_id)
std::optional<unsigned> Element::addNeighbor(Element* e)
{
if (e == this || e == nullptr || e->getDimension() != this->getDimension())
const unsigned dim(this->getDimension());
if (e == this || e == nullptr || e->getDimension() != dim)
{
return std::optional<unsigned>();
}
......@@ -56,7 +57,6 @@ std::optional<unsigned> Element::addNeighbor(Element* e)
const unsigned eNodes(e->getNumberOfBaseNodes());
const Node* const* e_nodes = e->getNodes();
unsigned count(0);
const unsigned dim(this->getDimension());
for (unsigned i(0); i < nNodes; i++)
{
for (unsigned j(0); j < eNodes; j++)
......
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