| 461 | } |
| 462 | |
| 463 | static void removeShortcuts( GraphNode & node ) |
| 464 | { |
| 465 | GraphAdjacentNodeArray & predecessors = node.getPredecessors(); |
| 466 | auto it = predecessors.begin(); |
| 467 | |
| 468 | while ( it != predecessors.end() ) |
| 469 | { |
| 470 | auto curr = *it; |
| 471 | bool found = false; |
| 472 | auto oit = predecessors.begin(); |
| 473 | while ( oit != predecessors.end() && !found ) |
| 474 | { |
| 475 | if ( oit != it ) |
| 476 | found = hasInPredecessors( **oit, *curr ); |
| 477 | ++oit; |
| 478 | } |
| 479 | |
| 480 | removeShortcuts( *curr ); |
| 481 | if ( found ) |
| 482 | it = predecessors.erase( it ); |
| 483 | else |
| 484 | ++it; |
| 485 | } |
| 486 | } |
| 487 | |
| 488 | static void sortNodes( GraphNode & node |
| 489 | , GraphNodePtrArray & sourceGraph |
no test coverage detected