call list::size() only once

This commit is contained in:
Andreas Fabri 2009-09-03 13:58:12 +00:00
parent 95afd598bc
commit faa063d065
1 changed files with 3 additions and 3 deletions

View File

@ -550,11 +550,11 @@ convex_hull_3(InputIterator first, InputIterator beyond,
// If the first and last point are equal the collinearity test some lines below will always be true. // If the first and last point are equal the collinearity test some lines below will always be true.
Point_3_list points(first, beyond); Point_3_list points(first, beyond);
while((points.size() > 1) && (points.front() == points.back())){
points.pop_back();
}
unsigned int size = points.size(); unsigned int size = points.size();
while((size > 1) && (points.front() == points.back())){
points.pop_back();
--size;
}
if ( size == 1 ) // 1 point if ( size == 1 ) // 1 point
{ {