1
0
Fork 0

Codechange: pass large parameter by reference instead of value, especially in a recursive function

pull/9288/head
rubidium42 2021-05-26 20:55:45 +02:00 committed by rubidium42
parent b791ffc6de
commit b9797a81c0
1 changed files with 2 additions and 2 deletions

View File

@ -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);