use const-ref for read-only parameters

quells static analyzer warnings
This commit is contained in:
Arne Morten Kvarving 2024-08-16 14:23:59 +02:00
parent 41bcc182bb
commit efc49e43b2
2 changed files with 8 additions and 8 deletions

View File

@ -348,7 +348,7 @@ std::vector<double> BoundaryGrid::Quad::evalBasis(double xi, double eta) const
return res;
}
BoundaryGrid::Vertex minXminY(std::vector<BoundaryGrid::Vertex>& in)
BoundaryGrid::Vertex minXminY(const std::vector<BoundaryGrid::Vertex>& in)
{
// find the nodes with minimal X
// then find the minimum Y among these
@ -358,7 +358,7 @@ BoundaryGrid::Vertex minXminY(std::vector<BoundaryGrid::Vertex>& in)
return *s.begin();
}
BoundaryGrid::Vertex maxXminY(std::vector<BoundaryGrid::Vertex>& in)
BoundaryGrid::Vertex maxXminY(const std::vector<BoundaryGrid::Vertex>& in)
{
// find the nodes with maximum X
// then find the minimum Y among these
@ -368,7 +368,7 @@ BoundaryGrid::Vertex maxXminY(std::vector<BoundaryGrid::Vertex>& in)
return *(s.end()-2);
}
BoundaryGrid::Vertex maxXmaxY(std::vector<BoundaryGrid::Vertex>& in)
BoundaryGrid::Vertex maxXmaxY(const std::vector<BoundaryGrid::Vertex>& in)
{
// find the nodes with maximum X
// then find the maximum Y among these
@ -378,7 +378,7 @@ BoundaryGrid::Vertex maxXmaxY(std::vector<BoundaryGrid::Vertex>& in)
return *(s.end()-1);
}
BoundaryGrid::Vertex minXmaxY(std::vector<BoundaryGrid::Vertex>& in)
BoundaryGrid::Vertex minXmaxY(const std::vector<BoundaryGrid::Vertex>& in)
{
// find the nodes with minimum X
// then find the maximum Y among these

View File

@ -489,19 +489,19 @@ class HexGeometry<2, cdim, GridImp>
//! \brief Find the vertex in the vector with minimum X and minimum Y
//! \returns The requested vertex
BoundaryGrid::Vertex minXminY(std::vector<BoundaryGrid::Vertex>& in);
BoundaryGrid::Vertex minXminY(const std::vector<BoundaryGrid::Vertex>& in);
//! \brief Find the vertex in the vector with maximum X and minimum Y
//! \returns The requested vertex
BoundaryGrid::Vertex maxXminY(std::vector<BoundaryGrid::Vertex>& in);
BoundaryGrid::Vertex maxXminY(const std::vector<BoundaryGrid::Vertex>& in);
//! \brief Find the vertex in the vector with maximum X and maximum Y
//! \returns The requested vertex
BoundaryGrid::Vertex maxXmaxY(std::vector<BoundaryGrid::Vertex>& in);
BoundaryGrid::Vertex maxXmaxY(const std::vector<BoundaryGrid::Vertex>& in);
//! \brief Find the vertex in the vector with minimum X and maximum Y
//! \returns The requested vertex
BoundaryGrid::Vertex minXmaxY(std::vector<BoundaryGrid::Vertex>& in);
BoundaryGrid::Vertex minXmaxY(const std::vector<BoundaryGrid::Vertex>& in);
}
}