From b9797a81c055c62c97d1838649466abd3a517a08 Mon Sep 17 00:00:00 2001 From: rubidium42 Date: Wed, 26 May 2021 20:55:45 +0200 Subject: Codechange: pass large parameter by reference instead of value, especially in a recursive function --- src/core/kdtree.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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 - 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 - 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); -- cgit v1.2.3-54-g00ecf