From b3ecf6985f7ea1629ffec7e1d025d16317e61185 Mon Sep 17 00:00:00 2001 From: David Capello Date: Thu, 15 Sep 2022 10:31:31 -0300 Subject: [PATCH] Prefer passing arguments by value instead of by reference when possible Accessing values should be faster than accessing reference/pointers. --- src/doc/octree_map.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/octree_map.cpp b/src/doc/octree_map.cpp index e275881ca..814b96bb7 100644 --- a/src/doc/octree_map.cpp +++ b/src/doc/octree_map.cpp @@ -235,7 +235,7 @@ void OctreeMap::feedWithImage(const Image* image, const bool imageIsRGBA = image->pixelFormat() == IMAGE_RGB; auto add_color_to_octree = - [this, &forceFullOpacity, &levelDeep, &imageIsRGBA](color_t color) { + [this, &forceFullOpacity, levelDeep, imageIsRGBA](color_t color) { const int alpha = (imageIsRGBA ? rgba_geta(color) : graya_geta(color)); if (alpha >= MIN_ALPHA_THRESHOLD) { // Colors which alpha is less than // MIN_ALPHA_THRESHOLD will not registered