Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Laurent Rineau <[email protected]>
  • Loading branch information
afabri and lrineau authored Apr 16, 2024
1 parent 3effd78 commit 5d6874d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Polygon/include/CGAL/General_polygon_with_holes_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class General_polygon_with_holes_2 {
{}

explicit General_polygon_with_holes_2(Polygon_2&& pgn_boundary) :
m_pgn(std::forward<Polygon_2>(pgn_boundary))
m_pgn(std::move(pgn_boundary))
{}

template <typename HolesInputIterator>
Expand All @@ -80,7 +80,7 @@ class General_polygon_with_holes_2 {
General_polygon_with_holes_2(Polygon_2&& pgn_boundary,
HolesInputIterator h_begin,
HolesInputIterator h_end) :
m_pgn(std::forward<Polygon_2>(pgn_boundary)),
m_pgn(std::move(pgn_boundary)),
m_holes(h_begin, h_end)
{}

Expand All @@ -104,7 +104,7 @@ class General_polygon_with_holes_2 {

void add_hole(const Polygon_2& pgn_hole) { m_holes.push_back(pgn_hole); }

void add_hole(Polygon_2&& pgn_hole) { m_holes.emplace_back(std::forward<Polygon_2>(pgn_hole)); }
void add_hole(Polygon_2&& pgn_hole) { m_holes.emplace_back(std::move(pgn_hole)); }

void erase_hole(Hole_iterator hit) { m_holes.erase(hit); }

Expand Down
6 changes: 3 additions & 3 deletions Polygon/include/CGAL/Multipolygon_with_holes_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ class Multipolygon_with_holes_2 {

void add_polygon(const Polygon_2& pgn) { m_polygons.push_back(Polygon_with_holes_2(pgn)); }

void add_polygon(Polygon_2&& pgn) { m_polygons.push_back(Polygon_with_holes_2(std::forward<Polygon_with_holes_2>(pgn))); }
void add_polygon(Polygon_2&& pgn) { m_polygons.emplace_back(std::move(pgn)); }

void add_polygon_with_holes(const Polygon_with_holes_2& pgn) { m_polygons.push_back(pgn); }

void add_polygon_with_holes(Polygon_with_holes_2&& pgn) { m_polygons.emplace_back(std::forward<Polygon_with_holes_2>(pgn)); }
void add_polygon_with_holes(Polygon_with_holes_2&& pgn) { m_polygons.emplace_back(std::move(pgn)); }

void push_back(const Polygon_with_holes_2& pgn) { m_polygons.push_back(pgn); }

Expand Down Expand Up @@ -199,7 +199,7 @@ Multipolygon_with_holes_2<Kernel, Container> transform(const Transformation& t,
{
Multipolygon_with_holes_2<Kernel, Container> result;
for(const auto& pwh : mp.polygons_with_holes()){
result.add_polygon_with_holes(std::move(transform(t, pwh)));
result.add_polygon_with_holes(transform(t, pwh));
}
return result;

Expand Down
6 changes: 3 additions & 3 deletions Polygon/include/CGAL/Polygon_with_holes_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class Polygon_with_holes_2 :

/*! Move constructor */
explicit Polygon_with_holes_2 (Polygon_2&& pgn_boundary) :
Base (std::forward<Polygon_2>(pgn_boundary))
Base (std::move(pgn_boundary))
{}

/*! Constructor from a polygon (outer boundary) and hole polygons. */
Expand All @@ -84,7 +84,7 @@ class Polygon_with_holes_2 :
Polygon_with_holes_2 (Polygon_2&& pgn_boundary,
HolesInputIterator h_begin,
HolesInputIterator h_end) :
Base (std::forward<Polygon_2>(pgn_boundary), h_begin, h_end)
Base (std::move(pgn_boundary), h_begin, h_end)
{}

/*! Obtain the bounding box of the polygon with holes */
Expand All @@ -98,7 +98,7 @@ class Polygon_with_holes_2 :
{
Polygon_with_holes_2<Kernel,Container> result(transform(t, pwh.outer_boundary()));
for(const auto& hole : pwh.holes()){
result.add_hole(std::move(transform(t, hole)));
result.add_hole(transform(t, hole));
}
return result;
}
Expand Down

0 comments on commit 5d6874d

Please sign in to comment.