mirror of https://github.com/CGAL/cgal
using std::distance and std::advance instead of counting
This commit is contained in:
parent
64ed32dc80
commit
d2da417b45
|
|
@ -70,16 +70,9 @@ _construct_envelope_non_vertical (Curve_pointer_iterator begin,
|
|||
else
|
||||
{
|
||||
// Divide the given range of curves into two.
|
||||
std::size_t size = std::distance(begin, end);
|
||||
Curve_pointer_iterator div_it = begin;
|
||||
unsigned int count = 0;
|
||||
|
||||
for (iter = begin; iter != end; ++iter)
|
||||
{
|
||||
if (count % 2 == 0)
|
||||
++div_it;
|
||||
|
||||
count++;
|
||||
}
|
||||
std::advance(div_it, size / 2);
|
||||
|
||||
// Construct the diagrams (envelopes) for the two sub-ranges recursively
|
||||
// and then merge the two diagrams to obtain the result.
|
||||
|
|
|
|||
Loading…
Reference in New Issue