Fixed a silly bug found by Thomas Hackl, thanks to Camille Wormser.

This commit is contained in:
Christophe Delage 2006-04-19 13:29:42 +00:00
parent 7c9efd472c
commit 23e9fe7522
1 changed files with 2 additions and 2 deletions

View File

@ -103,12 +103,12 @@ ch_melkman( InputIterator first, InputIterator last,
// right_turn( Q.back(), current, r)
{
s = current;
while ( !left_turn( r, s, Q.front()))
while (!Q.empty() && !left_turn( r, s, Q.front()))
// !left_turn( r, s, Q.front())
{ s = Q.front(); Q.pop_front(); }
Q.push_front(s);
s = current;
while ( !left_turn( s, r, Q.back()))
while (!Q.empty() && !left_turn( s, r, Q.back()))
// !right_turn( r, s, Q.back())
{ s = Q.back(); Q.pop_back(); }
Q.push_back(s);