From e58b4475e7fbd6cbe09435c1fa2bebebbbcc63fd Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Mon, 17 Jun 2019 15:24:43 +0200 Subject: [PATCH] clean-up --- .../internal/Iso_cuboid_3_Plane_3_intersection.h | 8 +++----- .../internal/Tetrahedron_3_Plane_3_intersection.h | 12 +++++------- .../internal/tetrahedron_intersection_helpers.h | 3 +-- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Plane_3_intersection.h b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Plane_3_intersection.h index 2715b9e40ae..9e292eaf6ee 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Plane_3_intersection.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Iso_cuboid_3_Plane_3_intersection.h @@ -37,7 +37,7 @@ namespace internal { template void filter_points(const std::vector& input, - std::vector& output) + std::vector& output) { std::set tmp; for( auto p : input) @@ -60,12 +60,10 @@ intersection( typedef typename K::Plane_3 Plane_3; typedef std::vector Poly; - typedef typename Intersection_traits, + typedef typename Intersection_traits, CGAL::Plane_3 >::result_type Result_type; - typedef typename Intersection_traits, + typedef typename Intersection_traits, CGAL::Plane_3 >::result_type Inter_type; std::vector edges; diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Plane_3_intersection.h b/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Plane_3_intersection.h index 3a6353c9809..8dcb4cd085d 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Plane_3_intersection.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Tetrahedron_3_Plane_3_intersection.h @@ -60,9 +60,9 @@ intersection( std::vector segments; for(std::size_t i = 0; i < 4; ++i) { - const typename K::Triangle_3 triangle(tet.vertex((i+1)%4), - tet.vertex((i+2)%4), - tet.vertex((i+3)%4)); + const typename K::Triangle_3 triangle(tet.vertex((i+1)%4), + tet.vertex((i+2)%4), + tet.vertex((i+3)%4)); intersections[i] = typename K::Intersect_3()(pl, triangle); if(intersections[i]){ if(const typename K::Triangle_3* tr = boost::get(&*intersections[i])) @@ -95,7 +95,7 @@ intersection( else { typename K::Point_3 p - = *boost::get(&*intersections[p_id]); + = *boost::get(&*intersections[p_id]); return Result_type(std::forward(p)); } @@ -125,9 +125,7 @@ intersection( } else //size = 4 { - std::list segs; - for(auto s : segments) - segs.push_back(s); + std::list segs(segments.begin(), segments.end()); std::list tmp; fill_points_list(segs, tmp); std::vector res; diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/tetrahedron_intersection_helpers.h b/Intersections_3/include/CGAL/Intersections_3/internal/tetrahedron_intersection_helpers.h index 36785471ca3..4525a9ea032 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/tetrahedron_intersection_helpers.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/tetrahedron_intersection_helpers.h @@ -43,8 +43,7 @@ void filter_segments(const std::vector& input, { Segment s = tmp.back(); tmp.pop_back(); - auto s_it = tmp.begin(); - for(; s_it != tmp.end();) + for(auto s_it = tmp.begin(); s_it != tmp.end();) { if(s == *s_it || s == s_it->opposite()) {