mirror of https://github.com/OpenTTD/OpenTTD
Codechange: pass large parameter by reference instead of value, especially in a recursive function
parent
b791ffc6de
commit
b9797a81c0
|
@ -274,7 +274,7 @@ class Kdtree {
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Outputter>
|
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 */
|
/* Dimension index of current level */
|
||||||
int dim = level % 2;
|
int dim = level % 2;
|
||||||
|
@ -458,7 +458,7 @@ public:
|
||||||
* @param outputter Callback used to return values from the search.
|
* @param outputter Callback used to return values from the search.
|
||||||
*/
|
*/
|
||||||
template <typename Outputter>
|
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(x1 < x2);
|
||||||
assert(y1 < y2);
|
assert(y1 < y2);
|
||||||
|
|
Loading…
Reference in New Issue