From 17686b48145372112bb8b5c4e68c62dfcbfa9a5a Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Thu, 11 Nov 2021 11:12:03 +0100 Subject: [PATCH] Slight performance boost follow up to f7db7c0 --- src/libslic3r/Model.cpp | 2 +- src/libslic3r/Model.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/Model.cpp b/src/libslic3r/Model.cpp index 55ca4b8da3..fec6e422c1 100644 --- a/src/libslic3r/Model.cpp +++ b/src/libslic3r/Model.cpp @@ -1893,7 +1893,7 @@ size_t ModelVolume::split(unsigned int max_extruders) // discard volumes for which the convex hull was not generated or is degenerate size_t i = 0; while (i < this->object->volumes.size()) { - std::shared_ptr hull = this->object->volumes[i]->get_convex_hull_shared_ptr(); + const std::shared_ptr &hull = this->object->volumes[i]->get_convex_hull_shared_ptr(); if (hull == nullptr || hull->its.vertices.empty() || hull->its.indices.empty()) { this->object->delete_volume(i); --idx; diff --git a/src/libslic3r/Model.hpp b/src/libslic3r/Model.hpp index e47ebda39a..3e11336afb 100644 --- a/src/libslic3r/Model.hpp +++ b/src/libslic3r/Model.hpp @@ -684,7 +684,7 @@ public: void calculate_convex_hull(); const TriangleMesh& get_convex_hull() const; - std::shared_ptr get_convex_hull_shared_ptr() const { return m_convex_hull; } + const std::shared_ptr& get_convex_hull_shared_ptr() const { return m_convex_hull; } // Get count of errors in the mesh int get_repaired_errors_count() const;