[skip ci] Add comments about order of post-processing calls

This commit is contained in:
Michael Krasnyk 2017-06-01 11:00:54 +02:00
parent dd009322de
commit d262c4dfaa
2 changed files with 10 additions and 0 deletions

View File

@ -165,6 +165,10 @@ class RouteAPI : public BaseAPI
* to find a via point.
* The same exit will be emitted, though, if we should start routing at S, making
* the overall response consistent.
*
* CAUTION: order of post-processing steps is important
* - postProcess must be called before collapseTurnInstructions that expects
* post-processed roundabouts without Exit instructions
*/
guidance::trimShortSegments(steps, leg_geometry);

View File

@ -315,6 +315,12 @@ RouteSteps collapseTurnInstructions(RouteSteps steps)
if (entersRoundabout(current_step->maneuver.instruction) ||
staysOnRoundabout(current_step->maneuver.instruction))
{
// If postProcess is called before then all corresponding leavesRoundabout steps are
// removed and the current roundabout step can be ignored by directly proceeding to
// the next step.
// If postProcess is not called before then all steps till the next leavesRoundabout
// step must be skipped to prevent incorrect roundabouts post-processing.
// are we done for good?
if (current_step + 1 == steps.end())
break;