Skip to content

Commit ebbcc5d

Browse files
committed
GRIDEDIT-2042 Minor refactoring
1 parent dfa0a4f commit ebbcc5d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

libs/MeshKernel/src/Mesh2D.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1878,6 +1878,8 @@ void Mesh2D::WalkMultiBoundaryFromNode(std::vector<bool>& edgeIsVisited,
18781878
meshBoundaryPolygon.emplace_back(subSequence[lastIndex]);
18791879

18801880
std::span<const Point> currentPolygon(meshBoundaryPolygon.data() + start, meshBoundaryPolygon.data() + meshBoundaryPolygon.size());
1881+
// Since the edge lies on a boundary, there will be only 1 attached element.
1882+
// This element will be in the 0th position
18811883
UInt connectedFace = m_edgesFaces[currentEdge][0];
18821884
bool isInPolygon = IsPointInPolygonNodes(m_facesMassCenters[connectedFace], currentPolygon, m_projection);
18831885

@@ -1886,14 +1888,11 @@ void Mesh2D::WalkMultiBoundaryFromNode(std::vector<bool>& edgeIsVisited,
18861888

18871889
if (!illegalCells.empty())
18881890
{
1889-
// If illecal cells is not empty then add the polygon separator
1891+
// If illegal cells array is not empty then add the polygon separator
18901892
illegalCells.emplace_back(constants::missing::doubleValue, constants::missing::doubleValue);
18911893
}
18921894

1893-
for (size_t ii = 0; ii < currentPolygon.size(); ++ii)
1894-
{
1895-
illegalCells.emplace_back(currentPolygon[ii]);
1896-
}
1895+
illegalCells.insert (illegalCells.end (), currentPolygon.begin (), currentPolygon.end ());
18971896
}
18981897

18991898
subSequence.resize(lastIndex);

0 commit comments

Comments
 (0)