diff options
author | Lukas Matena <lukasmatena@seznam.cz> | 2021-09-17 17:04:27 +0300 |
---|---|---|
committer | Lukas Matena <lukasmatena@seznam.cz> | 2022-01-19 23:45:24 +0300 |
commit | 8373a6f93d4de8f4f765f368256ed6c5815f0e26 (patch) | |
tree | b890d997849c6a1b7fc184c10c2916d73148a078 | |
parent | 0f11fbc961dc5d1ee5da3a7220f5c45bce7c01f4 (diff) |
Fixed several std::moves that had no effect, moved GCode data to heaplm_improvements
-rw-r--r-- | src/libslic3r/ExPolygon.hpp | 10 | ||||
-rw-r--r-- | src/libslic3r/ExtrusionEntity.hpp | 2 | ||||
-rw-r--r-- | src/libslic3r/Model.hpp | 2 | ||||
-rw-r--r-- | src/libslic3r/Polygon.hpp | 6 | ||||
-rw-r--r-- | src/libslic3r/Polyline.hpp | 2 | ||||
-rw-r--r-- | src/libslic3r/Print.cpp | 4 | ||||
-rw-r--r-- | src/libslic3r/Surface.hpp | 10 |
7 files changed, 18 insertions, 18 deletions
diff --git a/src/libslic3r/ExPolygon.hpp b/src/libslic3r/ExPolygon.hpp index 6f3884673..cbf6b1c1a 100644 --- a/src/libslic3r/ExPolygon.hpp +++ b/src/libslic3r/ExPolygon.hpp @@ -169,10 +169,10 @@ inline Polylines to_polylines(ExPolygon &&src) Polyline &pl = polylines[idx ++]; pl.points = std::move(src.contour.points); pl.points.push_back(pl.points.front()); - for (Polygons::const_iterator ith = src.holes.begin(); ith != src.holes.end(); ++ith) { + for (auto ith = src.holes.begin(); ith != src.holes.end(); ++ith) { Polyline &pl = polylines[idx ++]; pl.points = std::move(ith->points); - pl.points.push_back(ith->points.front()); + pl.points.push_back(pl.points.front()); } assert(idx == polylines.size()); return polylines; @@ -183,14 +183,14 @@ inline Polylines to_polylines(ExPolygons &&src) Polylines polylines; polylines.assign(number_polygons(src), Polyline()); size_t idx = 0; - for (ExPolygons::const_iterator it = src.begin(); it != src.end(); ++it) { + for (auto it = src.begin(); it != src.end(); ++it) { Polyline &pl = polylines[idx ++]; pl.points = std::move(it->contour.points); pl.points.push_back(pl.points.front()); - for (Polygons::const_iterator ith = it->holes.begin(); ith != it->holes.end(); ++ith) { + for (auto ith = it->holes.begin(); ith != it->holes.end(); ++ith) { Polyline &pl = polylines[idx ++]; pl.points = std::move(ith->points); - pl.points.push_back(ith->points.front()); + pl.points.push_back(pl.points.front()); } } assert(idx == polylines.size()); diff --git a/src/libslic3r/ExtrusionEntity.hpp b/src/libslic3r/ExtrusionEntity.hpp index 1c990f5ea..5e6a51d20 100644 --- a/src/libslic3r/ExtrusionEntity.hpp +++ b/src/libslic3r/ExtrusionEntity.hpp @@ -242,7 +242,7 @@ public: ExtrusionLoop(ExtrusionPaths &&paths, ExtrusionLoopRole role = elrDefault) : paths(std::move(paths)), m_loop_role(role) {} ExtrusionLoop(const ExtrusionPath &path, ExtrusionLoopRole role = elrDefault) : m_loop_role(role) { this->paths.push_back(path); } - ExtrusionLoop(const ExtrusionPath &&path, ExtrusionLoopRole role = elrDefault) : m_loop_role(role) + ExtrusionLoop(ExtrusionPath &&path, ExtrusionLoopRole role = elrDefault) : m_loop_role(role) { this->paths.emplace_back(std::move(path)); } bool is_loop() const override{ return true; } bool can_reverse() const override { return false; } diff --git a/src/libslic3r/Model.hpp b/src/libslic3r/Model.hpp index 7a1cf206e..14d063155 100644 --- a/src/libslic3r/Model.hpp +++ b/src/libslic3r/Model.hpp @@ -817,7 +817,7 @@ private: this->set_material_id(other.material_id()); } // Providing a new mesh, therefore this volume will get a new unique ID assigned. - ModelVolume(ModelObject *object, const ModelVolume &other, const TriangleMesh &&mesh) : + ModelVolume(ModelObject *object, const ModelVolume &other, TriangleMesh &&mesh) : name(other.name), source(other.source), m_mesh(new TriangleMesh(std::move(mesh))), config(other.config), m_type(other.m_type), object(object), m_transformation(other.m_transformation) { assert(this->id().valid()); diff --git a/src/libslic3r/Polygon.hpp b/src/libslic3r/Polygon.hpp index 7d34e3aae..12e492f29 100644 --- a/src/libslic3r/Polygon.hpp +++ b/src/libslic3r/Polygon.hpp @@ -220,10 +220,10 @@ inline Polylines to_polylines(Polygons &&polys) Polylines polylines; polylines.assign(polys.size(), Polyline()); size_t idx = 0; - for (Polygons::const_iterator it = polys.begin(); it != polys.end(); ++ it) { + for (auto it = polys.begin(); it != polys.end(); ++ it) { Polyline &pl = polylines[idx ++]; pl.points = std::move(it->points); - pl.points.push_back(it->points.front()); + pl.points.push_back(pl.points.front()); } assert(idx == polylines.size()); return polylines; @@ -242,7 +242,7 @@ inline Polygons to_polygons(std::vector<Points> &&paths) { Polygons out; out.reserve(paths.size()); - for (const Points &path : paths) + for (Points &path : paths) out.emplace_back(std::move(path)); return out; } diff --git a/src/libslic3r/Polyline.hpp b/src/libslic3r/Polyline.hpp index 23df083cd..eee6c7710 100644 --- a/src/libslic3r/Polyline.hpp +++ b/src/libslic3r/Polyline.hpp @@ -138,7 +138,7 @@ inline Polylines to_polylines(std::vector<Points> &&paths) { Polylines out; out.reserve(paths.size()); - for (const Points &path : paths) + for (Points &path : paths) out.emplace_back(std::move(path)); return out; } diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index d82a1a093..a89d5a5ba 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -868,8 +868,8 @@ std::string Print::export_gcode(const std::string& path_template, GCodeProcessor this->set_status(90, message); // The following line may die for multiple reasons. - GCode gcode; - gcode.do_export(this, path.c_str(), result, thumbnail_cb); + std::unique_ptr<GCode> gcode(new GCode); + gcode->do_export(this, path.c_str(), result, thumbnail_cb); return path.c_str(); } diff --git a/src/libslic3r/Surface.hpp b/src/libslic3r/Surface.hpp index 4920efbbf..ef1de30e9 100644 --- a/src/libslic3r/Surface.hpp +++ b/src/libslic3r/Surface.hpp @@ -58,11 +58,11 @@ public: thickness(rhs.thickness), thickness_layers(rhs.thickness_layers), bridge_angle(rhs.bridge_angle), extra_perimeters(rhs.extra_perimeters) {}; - Surface(SurfaceType _surface_type, const ExPolygon &&_expolygon) + Surface(SurfaceType _surface_type, ExPolygon &&_expolygon) : surface_type(_surface_type), expolygon(std::move(_expolygon)), thickness(-1), thickness_layers(1), bridge_angle(-1), extra_perimeters(0) {}; - Surface(const Surface &other, const ExPolygon &&_expolygon) + Surface(const Surface &other, ExPolygon &&_expolygon) : surface_type(other.surface_type), expolygon(std::move(_expolygon)), thickness(other.thickness), thickness_layers(other.thickness_layers), bridge_angle(other.bridge_angle), extra_perimeters(other.extra_perimeters) @@ -159,7 +159,7 @@ inline ExPolygons to_expolygons(Surfaces &&src) { ExPolygons expolygons; expolygons.reserve(src.size()); - for (Surfaces::const_iterator it = src.begin(); it != src.end(); ++it) + for (auto it = src.begin(); it != src.end(); ++it) expolygons.emplace_back(ExPolygon(std::move(it->expolygon))); src.clear(); return expolygons; @@ -260,8 +260,8 @@ inline void surfaces_append(Surfaces &dst, ExPolygons &&src, SurfaceType surface inline void surfaces_append(Surfaces &dst, ExPolygons &&src, const Surface &surfaceTempl) { dst.reserve(dst.size() + number_polygons(src)); - for (ExPolygons::const_iterator it = src.begin(); it != src.end(); ++ it) - dst.emplace_back(Surface(surfaceTempl, std::move(*it))); + for (ExPolygon& explg : src) + dst.emplace_back(Surface(surfaceTempl, std::move(explg))); src.clear(); } |