Skip to content

Commit

Permalink
Remove impossible to hit code path - distance is never < 0
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 30, 2019
1 parent 0b451b2 commit 3d9386b
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/core/pal/feature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -967,18 +967,6 @@ int FeaturePart::createCandidatesAlongLineNearMidpoint( QList<LabelPosition *> &

LabelPosition *FeaturePart::curvedPlacementAtOffset( PointSet *path_positions, double *path_distances, int &orientation, int index, double distance, bool &reversed, bool &flip )
{
// Check that the given distance is on the given index and find the correct index and distance if not
while ( distance < 0 && index > 1 )
{
index--;
distance += path_distances[index];
}

if ( index <= 1 && distance < 0 ) // We've gone off the start, fail out
{
return nullptr;
}

// Same thing, checking if we go off the end
while ( index < path_positions->nbPoints && distance > path_distances[index] )
{
Expand Down

0 comments on commit 3d9386b

Please sign in to comment.