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
(cherry picked from commit 3d9386b)
  • Loading branch information
nyalldawson committed Jun 10, 2019
1 parent 0560348 commit 1660f78
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/core/pal/feature.cpp
Expand Up @@ -966,18 +966,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 1660f78

Please sign in to comment.