@@ -48,6 +48,13 @@ template
48
48
>
49
49
struct traversal_switch_detector
50
50
{
51
+ static const operation_type target_operation
52
+ = operation_from_overlay<OverlayType>::value;
53
+ static const operation_type opposite_operation
54
+ = target_operation == operation_union
55
+ ? operation_intersection
56
+ : operation_union;
57
+
51
58
enum isolation_type
52
59
{
53
60
isolation_unknown = -1 ,
@@ -322,6 +329,12 @@ struct traversal_switch_detector
322
329
{
323
330
turn_type& turn = m_turns[*sit];
324
331
332
+ if (! acceptable (turn))
333
+ {
334
+ // No assignment necessary
335
+ continue ;
336
+ }
337
+
325
338
for (int i = 0 ; i < 2 ; i++)
326
339
{
327
340
turn_operation_type& op = turn.operations [i];
@@ -382,12 +395,19 @@ struct traversal_switch_detector
382
395
}
383
396
}
384
397
398
+ inline bool acceptable (turn_type const & turn) const
399
+ {
400
+ // Discarded turns don't connect rings to the same region
401
+ // Also xx are not relevant
402
+ // (otherwise discarded colocated uu turn could make a connection)
403
+ return ! turn.discarded
404
+ && ! turn.both (operation_blocked);
405
+ }
406
+
385
407
inline bool connects_same_region (turn_type const & turn) const
386
408
{
387
- if (turn. discarded )
409
+ if (! acceptable ( turn) )
388
410
{
389
- // Discarded turns don't connect same region (otherwise discarded colocated uu turn
390
- // could make a connection)
391
411
return false ;
392
412
}
393
413
@@ -397,7 +417,7 @@ struct traversal_switch_detector
397
417
return ! (turn.both (operation_union) || turn.both (operation_intersection));
398
418
}
399
419
400
- if (operation_from_overlay<OverlayType>::value == operation_union)
420
+ if (target_operation == operation_union)
401
421
{
402
422
// It is a cluster, check zones
403
423
// (assigned by sort_by_side/handle colocations) of both operations
@@ -492,8 +512,7 @@ struct traversal_switch_detector
492
512
{
493
513
turn_type const & turn = m_turns[turn_index];
494
514
495
- if (turn.discarded
496
- && operation_from_overlay<OverlayType>::value == operation_intersection)
515
+ if (turn.discarded && target_operation == operation_intersection)
497
516
{
498
517
// Discarded turn (union currently still needs it to determine regions)
499
518
continue ;
0 commit comments