diff --git a/include/SkeletalTrapezoidationEdge.h b/include/SkeletalTrapezoidationEdge.h index aa897d830f..4c0bfb365c 100644 --- a/include/SkeletalTrapezoidationEdge.h +++ b/include/SkeletalTrapezoidationEdge.h @@ -80,7 +80,7 @@ class SkeletalTrapezoidationEdge { return transitions.use_count() > 0 && (ignore_empty || ! transitions.lock()->empty()); } - void setTransitions(std::shared_ptr> storage) + void setTransitions(std::shared_ptr>& storage) { transitions = storage; } @@ -93,7 +93,7 @@ class SkeletalTrapezoidationEdge { return transition_ends.use_count() > 0 && (ignore_empty || ! transition_ends.lock()->empty()); } - void setTransitionEnds(std::shared_ptr> storage) + void setTransitionEnds(std::shared_ptr>& storage) { transition_ends = storage; } @@ -106,7 +106,7 @@ class SkeletalTrapezoidationEdge { return extrusion_junctions.use_count() > 0 && (ignore_empty || ! extrusion_junctions.lock()->empty()); } - void setExtrusionJunctions(std::shared_ptr storage) + void setExtrusionJunctions(std::shared_ptr& storage) { extrusion_junctions = storage; } diff --git a/include/SkeletalTrapezoidationJoint.h b/include/SkeletalTrapezoidationJoint.h index 603b9b452f..7c7575a07b 100644 --- a/include/SkeletalTrapezoidationJoint.h +++ b/include/SkeletalTrapezoidationJoint.h @@ -43,7 +43,7 @@ class SkeletalTrapezoidationJoint { return beading.use_count() > 0; } - void setBeading(std::shared_ptr storage) + void setBeading(std::shared_ptr& storage) { beading = storage; } diff --git a/include/infill.h b/include/infill.h index 7c6a342499..40ca7fbd59 100644 --- a/include/infill.h +++ b/include/infill.h @@ -203,8 +203,8 @@ class Infill const Settings& settings, int layer_idx, SectionType section_type, - const std::shared_ptr cross_fill_provider = nullptr, - const std::shared_ptr lightning_layer = nullptr, + const std::shared_ptr& cross_fill_provider = nullptr, + const std::shared_ptr& lightning_layer = nullptr, const SliceMeshStorage* mesh = nullptr, const Polygons& prevent_small_exposed_to_air = Polygons(), const bool is_bridge_skin = false); @@ -242,8 +242,8 @@ class Infill Polygons& result_polygons, Polygons& result_lines, const Settings& settings, - const std::shared_ptr cross_fill_pattern = nullptr, - const std::shared_ptr lightning_layer = nullptr, + const std::shared_ptr& cross_fill_pattern = nullptr, + const std::shared_ptr& lightning_layer = nullptr, const SliceMeshStorage* mesh = nullptr); /*! @@ -402,7 +402,7 @@ class Infill * see https://hal.archives-ouvertes.fr/hal-02155929/document * \param result (output) The resulting polygons */ - void generateLightningInfill(const std::shared_ptr lightning_layer, Polygons& result_lines); + void generateLightningInfill(const std::shared_ptr& lightning_layer, Polygons& result_lines); /*! * Generate sparse concentric infill diff --git a/src/communication/ArcusCommunication.cpp b/src/communication/ArcusCommunication.cpp index cf17d69454..44cc58cbe2 100644 --- a/src/communication/ArcusCommunication.cpp +++ b/src/communication/ArcusCommunication.cpp @@ -420,7 +420,7 @@ void ArcusCommunication::sendOptimizedLayerData() } spdlog::info("Sending {} layers.", data.current_layer_count); - for (std::pair> entry : data.slice_data) // Note: This is in no particular order! + for (const auto& entry : data.slice_data) // Note: This is in no particular order! { spdlog::debug("Sending layer data for layer {} of {}.", entry.first, data.slice_data.size()); private_data->socket->sendMessage(entry.second); // Send the actual layers. diff --git a/src/infill.cpp b/src/infill.cpp index 6bdd545aaa..9137aa66ca 100644 --- a/src/infill.cpp +++ b/src/infill.cpp @@ -88,8 +88,8 @@ void Infill::generate( const Settings& settings, int layer_idx, SectionType section_type, - const std::shared_ptr cross_fill_provider, - const std::shared_ptr lightning_trees, + const std::shared_ptr& cross_fill_provider, + const std::shared_ptr& lightning_trees, const SliceMeshStorage* mesh, const Polygons& prevent_small_exposed_to_air, const bool is_bridge_skin) @@ -255,8 +255,8 @@ void Infill::_generate( Polygons& result_polygons, Polygons& result_lines, const Settings& settings, - const std::shared_ptr cross_fill_provider, - const std::shared_ptr lightning_trees, + const std::shared_ptr& cross_fill_provider, + const std::shared_ptr& lightning_trees, const SliceMeshStorage* mesh) { if (inner_contour.empty()) @@ -432,7 +432,7 @@ void Infill::generateGyroidInfill(Polygons& result_lines, Polygons& result_polyg PolylineStitcher::stitch(line_segments, result_lines, result_polygons, infill_line_width); } -void Infill::generateLightningInfill(const std::shared_ptr trees, Polygons& result_lines) +void Infill::generateLightningInfill(const std::shared_ptr& trees, Polygons& result_lines) { // Don't need to support areas smaller than line width, as they are always within radius: if (std::abs(inner_contour.area()) < infill_line_width || ! trees)