use lambda to decide turn value

This commit is contained in:
Emil Tin 2014-08-20 11:48:47 +02:00
parent bcd55626ef
commit 00dd2463fd

View File

@ -89,11 +89,19 @@ void DescriptionFactory::AppendSegment(const FixedPointCoordinate &coordinate,
} }
// make sure mode changes are announced, even when there otherwise is no turn // make sure mode changes are announced, even when there otherwise is no turn
const TurnInstruction turn = const TurnInstruction turn = [] -> TurnInstruction ()
(TurnInstruction::NoTurn == path_point.turn_instruction && {
if (TurnInstruction::NoTurn == path_point.turn_instruction &&
path_description.front().travel_mode != path_point.travel_mode && path_description.front().travel_mode != path_point.travel_mode &&
path_point.segment_duration>0) ? TurnInstruction::GoStraight path_point.segment_duration>0)
: path_point.turn_instruction; {
return TurnInstruction::GoStraight;
}
else
{
return path_point.turn_instruction
}
}
path_description.emplace_back(coordinate, path_description.emplace_back(coordinate,
path_point.name_id, path_point.name_id,