diff --git a/src/libslic3r/Polygon.cpp b/src/libslic3r/Polygon.cpp index 87bc05b852..0d4f3ec128 100644 --- a/src/libslic3r/Polygon.cpp +++ b/src/libslic3r/Polygon.cpp @@ -471,10 +471,8 @@ void remove_with_small_diameter(Polygons &polygons, double min_diameter) size_t end = 0; for (size_t i = 0; i < polygons.size(); ++ i) { Polygon &poly = polygons[i]; - bool keep = true; - if (poly.size() < 2) { - keep = false; - } else { + bool keep = false; + if (poly.size() >= 2) { Point pmin = poly.front(); Point pmax = poly.points[1]; for (size_t k = 2; k < poly.size(); ++k) { @@ -519,8 +517,8 @@ void remove_with_small_diameter(Polygons &polygons, double min_diameter) ++ end; } #endif - polygons.erase(polygons.begin() + end, polygons.end()); } + polygons.erase(polygons.begin() + end, polygons.end()); } void remove_collinear(Polygon &poly)