]> git.lyx.org Git - lyx.git/commitdiff
Graph::getReachable(): pass a parameter by const reference
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 12 Sep 2024 16:20:43 +0000 (18:20 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 12 Sep 2024 16:20:43 +0000 (18:20 +0200)
Spotted by coverity.

src/Graph.cpp
src/Graph.h

index 0165bdacc9a4c95d626f21996f83f010c1a52959..608d0bd8b5d99cb12b8de0105ee7c6dd46129f9e 100644 (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;
index 3f3404052f880b33a7cca7ffed89c92cfe2d99dc..4361ca11126c10550a730ad2e0e360d4d234053f 100644 (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