From: Jean-Marc Lasgouttes Date: Thu, 12 Sep 2024 16:20:43 +0000 (+0200) Subject: Graph::getReachable(): pass a parameter by const reference X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=b743870d71db1c13e10078e1bb7028e9db1af377;p=lyx.git Graph::getReachable(): pass a parameter by const reference Spotted by coverity. --- diff --git a/src/Graph.cpp b/src/Graph.cpp index 0165bdacc9..608d0bd8b5 100644 --- a/src/Graph.cpp +++ b/src/Graph.cpp @@ -79,9 +79,8 @@ Graph::EdgePath const } -Graph::EdgePath const - Graph::getReachable(int from, bool only_viewable, - bool clear_visited, set excludes) +Graph::EdgePath const Graph::getReachable(int from, bool only_viewable, bool clear_visited, + set const & excludes) { EdgePath result; queue Q; diff --git a/src/Graph.h b/src/Graph.h index 3f3404052f..4361ca1112 100644 --- a/src/Graph.h +++ b/src/Graph.h @@ -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 excludes = std::set()); + EdgePath const getReachable(int from, bool only_viewable, bool clear_visited, + std::set const & excludes = std::set()); /// can "from" be reached from "to"? bool isReachable(int from, int to); /// find a path from "from" to "to". always returns one of the