diff --git a/Convex_hull_2/examples/Convex_hull_2/ch_graham_anderson.cpp b/Convex_hull_2/examples/Convex_hull_2/ch_graham_anderson.cpp index a63e5c63865..53b1ea97b5e 100644 --- a/Convex_hull_2/examples/Convex_hull_2/ch_graham_anderson.cpp +++ b/Convex_hull_2/examples/Convex_hull_2/ch_graham_anderson.cpp @@ -24,12 +24,13 @@ ch_graham_anderson( InputIterator first, InputIterator beyond, typename std::vector< Point_2 >::iterator it = std::min_element(V.begin(), V.end(), Less_xy_2()); std::sort( V.begin(), V.end(), boost::bind(Less_rotate_ccw_2(), *it, _1, _2) ); - if ( *(V.begin()) == *(V.rbegin()) ) + if ( *(V.begin()) != *(V.rbegin()) ) { - *result = *(V.begin()); ++result; - return result; + result = CGAL::ch_graham_andrew_scan( V.begin(), V.end(), result, ch_traits); } - return CGAL::ch_graham_andrew_scan( V.begin(), V.end(), result, ch_traits); + *result = *(V.rbegin()); ++result; + return result; + } int main()