diff options
author | rubidium42 <rubidium@openttd.org> | 2021-05-26 20:55:45 +0200 |
---|---|---|
committer | rubidium42 <rubidium42@users.noreply.github.com> | 2021-05-27 18:30:56 +0200 |
commit | b9797a81c055c62c97d1838649466abd3a517a08 (patch) | |
tree | 3a5091d6efe643e03d3bc99db1091dd78f2f9a6d | |
parent | b791ffc6de6dcc33739bb36bec4824dc44417961 (diff) | |
download | openttd-b9797a81c055c62c97d1838649466abd3a517a08.tar.xz |
Codechange: pass large parameter by reference instead of value, especially in a recursive function
-rw-r--r-- | src/core/kdtree.hpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/kdtree.hpp b/src/core/kdtree.hpp index 392e31b8e..cb864e04d 100644 --- a/src/core/kdtree.hpp +++ b/src/core/kdtree.hpp @@ -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); |