[LyX/master] Graph::getReachable(): pass a parameter by const reference

Jean-Marc Lasgouttes lasgouttes at lyx.org
Thu Sep 12 16:21:25 UTC 2024


commit b743870d71db1c13e10078e1bb7028e9db1af377
Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
Date:   Thu Sep 12 18:20:43 2024 +0200

    Graph::getReachable(): pass a parameter by const reference
    
    Spotted by coverity.
---
 src/Graph.cpp | 5 ++---
 src/Graph.h   | 4 ++--
 2 files changed, 4 insertions(+), 5 deletions(-)

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<int> excludes)
+Graph::EdgePath const Graph::getReachable(int from, bool only_viewable, bool clear_visited,
+	                                      set<int> const & excludes)
 {
 	EdgePath result;
 	queue<int> 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<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


More information about the lyx-cvs mailing list