Changeset - r25519:70dba0513fbc
[Not reviewed]
master
0 1 0
rubidium42 - 3 years ago 2021-05-26 18:55:45
rubidium@openttd.org
Codechange: pass large parameter by reference instead of value, especially in a recursive function
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/core/kdtree.hpp
Show inline comments
 
@@ -274,7 +274,7 @@ class Kdtree {
 
	}
 

	
 
	template <typename Outputter>
 
	void FindContainedRecursive(CoordT p1[2], CoordT p2[2], size_t node_idx, int level, Outputter outputter) const
 
	void FindContainedRecursive(CoordT p1[2], CoordT p2[2], size_t node_idx, int level, const Outputter &outputter) const
 
	{
 
		/* Dimension index of current level */
 
		int dim = level % 2;
 
@@ -458,7 +458,7 @@ public:
 
	* @param outputter Callback used to return values from the search.
 
	*/
 
	template <typename Outputter>
 
	void FindContained(CoordT x1, CoordT y1, CoordT x2, CoordT y2, Outputter outputter) const
 
	void FindContained(CoordT x1, CoordT y1, CoordT x2, CoordT y2, const Outputter &outputter) const
 
	{
 
		assert(x1 < x2);
 
		assert(y1 < y2);
0 comments (0 inline, 0 general)