From 89cf29080b87c9d42bdeba060df1d85d5f79276b Mon Sep 17 00:00:00 2001 From: bubnikv Date: Fri, 4 Nov 2016 17:20:32 +0100 Subject: [PATCH] Fix of https://github.com/prusa3d/Slic3r/issues/14 A to_polygons(SurfacePtrs &&) method does not make sense as the ownership of the Surfaces stored in the pointer array is not known. Thanks to @flannelhead for precisely pinpointing this issue. --- xs/src/libslic3r/Surface.hpp | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/xs/src/libslic3r/Surface.hpp b/xs/src/libslic3r/Surface.hpp index 09bc3e5f5..d48b59557 100644 --- a/xs/src/libslic3r/Surface.hpp +++ b/xs/src/libslic3r/Surface.hpp @@ -96,24 +96,6 @@ inline Polygons to_polygons(const SurfacesPtr &src) return polygons; } -#if SLIC3R_CPPVER >= 11 -inline Polygons to_polygons(SurfacesPtr &&src) -{ - size_t num = 0; - for (SurfacesPtr::const_iterator it = src.begin(); it != src.end(); ++it) - num += (*it)->expolygon.holes.size() + 1; - Polygons polygons; - polygons.reserve(num); - for (SurfacesPtr::const_iterator it = src.begin(); it != src.end(); ++it) { - polygons.push_back(std::move((*it)->expolygon.contour)); - for (Polygons::const_iterator ith = (*it)->expolygon.holes.begin(); ith != (*it)->expolygon.holes.end(); ++ith) { - polygons.push_back(std::move(*ith)); - } - } - return polygons; -} -#endif - // Count a nuber of polygons stored inside the vector of expolygons. // Useful for allocating space for polygons when converting expolygons to polygons. inline size_t number_polygons(const Surfaces &surfaces)