@@ -257,7 +257,7 @@ Intersection TurnHandler::handleThreeWayTurn(const EdgeID via_edge, Intersection
257257 { return node_based_graph.GetEdgeData (road.eid ).flags .road_classification .IsLinkClass (); });
258258
259259 auto fork = findFork (via_edge, intersection);
260- if (fork && (all_links || obvious_index == 0 ))
260+ if (fork && (all_links || ! obvious_index))
261261 {
262262 assignFork (via_edge, fork->getLeft (), fork->getRight ());
263263 }
@@ -269,7 +269,7 @@ Intersection TurnHandler::handleThreeWayTurn(const EdgeID via_edge, Intersection
269269 I
270270 I
271271 */
272- else if (isEndOfRoad (intersection[0 ], intersection[1 ], intersection[2 ]) && obvious_index == 0 )
272+ else if (isEndOfRoad (intersection[0 ], intersection[1 ], intersection[2 ]) && ! obvious_index)
273273 {
274274 if (intersection[1 ].entry_allowed )
275275 {
@@ -286,11 +286,11 @@ Intersection TurnHandler::handleThreeWayTurn(const EdgeID via_edge, Intersection
286286 intersection[2 ].instruction = {TurnType::OnRamp, DirectionModifier::Left};
287287 }
288288 }
289- else if (obvious_index != 0 ) // has an obvious continuing road/obvious turn
289+ else if (obvious_index) // has an obvious continuing road/obvious turn
290290 {
291291 const auto direction_at_one = getTurnDirection (intersection[1 ].angle );
292292 const auto direction_at_two = getTurnDirection (intersection[2 ].angle );
293- if (obvious_index == 1 )
293+ if (* obvious_index == 1 )
294294 {
295295 intersection[1 ].instruction =
296296 getInstructionForObvious (3 ,
@@ -312,7 +312,7 @@ Intersection TurnHandler::handleThreeWayTurn(const EdgeID via_edge, Intersection
312312 }
313313 else
314314 {
315- BOOST_ASSERT (obvious_index == 2 );
315+ BOOST_ASSERT (* obvious_index == 2 );
316316 intersection[2 ].instruction =
317317 getInstructionForObvious (3 ,
318318 via_edge,
@@ -344,30 +344,30 @@ Intersection TurnHandler::handleThreeWayTurn(const EdgeID via_edge, Intersection
344344
345345Intersection TurnHandler::handleComplexTurn (const EdgeID via_edge, Intersection intersection) const
346346{
347- const std:: size_t obvious_index = findObviousTurn (via_edge, intersection);
347+ const auto obvious_index = findObviousTurn (via_edge, intersection);
348348 const auto fork = findFork (via_edge, intersection);
349349
350350 const auto straightmost = intersection.findClosestTurn (STRAIGHT_ANGLE );
351351 const auto straightmost_index = std::distance (intersection.begin (), straightmost);
352352 const auto straightmost_angle_dev = angularDeviation (straightmost->angle , STRAIGHT_ANGLE );
353353
354354 // check whether the obvious choice is actually a through street
355- if (obvious_index != 0 )
355+ if (obvious_index)
356356 {
357- intersection[obvious_index].instruction =
357+ intersection[* obvious_index].instruction =
358358 getInstructionForObvious (intersection.size (),
359359 via_edge,
360- isThroughStreet (obvious_index,
360+ isThroughStreet (* obvious_index,
361361 intersection,
362362 node_based_graph,
363363 node_data_container,
364364 string_table,
365365 street_name_suffix_table),
366- intersection[obvious_index]);
366+ intersection[* obvious_index]);
367367
368368 // assign left/right turns
369- intersection = assignLeftTurns (via_edge, std::move (intersection), obvious_index);
370- intersection = assignRightTurns (via_edge, std::move (intersection), obvious_index);
369+ intersection = assignLeftTurns (via_edge, std::move (intersection), * obvious_index);
370+ intersection = assignRightTurns (via_edge, std::move (intersection), * obvious_index);
371371 }
372372 else if (fork) // found fork
373373 {
0 commit comments