Reduce extra loop comparison

This commit is contained in:
Seth Hillbrand 2018-04-30 09:14:23 -07:00
parent 2f5fdcf329
commit 12487e14ab
1 changed files with 5 additions and 3 deletions

View File

@ -799,9 +799,9 @@ bool LINE::HasLoops() const
{ {
for( int i = 0; i < PointCount(); i++ ) for( int i = 0; i < PointCount(); i++ )
{ {
for( int j = 0; j < PointCount(); j++ ) for( int j = i + 2; j < PointCount(); j++ )
{ {
if( ( std::abs( i - j ) > 1 ) && CPoint( i ) == CPoint( j ) ) if( CPoint( i ) == CPoint( j ) )
return true; return true;
} }
} }
@ -864,7 +864,9 @@ OPT_BOX2I LINE::ChangedArea( const LINE* aOther ) const
i_start = i; i_start = i;
break; break;
} }
} else { }
else
{
i_start = i; i_start = i;
break; break;
} }