Prefer passing arguments by value instead of by reference when possible

Accessing values should be faster than accessing reference/pointers.
This commit is contained in:
David Capello 2022-09-15 10:31:31 -03:00
parent c4fefadf79
commit b3ecf6985f

View File

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