Graph::getReachable(): pass a parameter by const reference

Spotted by coverity.
This commit is contained in:
Jean-Marc Lasgouttes 2024-09-12 18:20:43 +02:00
parent b1bbf64a28
commit b743870d71
2 changed files with 4 additions and 5 deletions

View File

@ -79,9 +79,8 @@ Graph::EdgePath const
}
Graph::EdgePath const
Graph::getReachable(int from, bool only_viewable,
bool clear_visited, set<int> excludes)
Graph::EdgePath const Graph::getReachable(int from, bool only_viewable, bool clear_visited,
set<int> const & excludes)
{
EdgePath result;
queue<int> Q;

View File

@ -33,8 +33,8 @@ public:
/// \return a vector of the vertices from which "to" can be reached
EdgePath const getReachableTo(int to, bool clear_visited);
/// \return a vector of the reachable vertices, avoiding all "excludes"
EdgePath const getReachable(int from, bool only_viewable,
bool clear_visited, std::set<int> excludes = std::set<int>());
EdgePath const getReachable(int from, bool only_viewable, bool clear_visited,
std::set<int> const & excludes = std::set<int>());
/// can "from" be reached from "to"?
bool isReachable(int from, int to);
/// find a path from "from" to "to". always returns one of the