(
txn: &T,
options: &RetrieveOptions,
start: GraphNode<NodeId>,
target: GraphNode<NodeId>,
)
| 568 | } |
| 569 | |
| 570 | fn visible_chain_reaches<T: GraphTxnT>( |
| 571 | txn: &T, |
| 572 | options: &RetrieveOptions, |
| 573 | start: GraphNode<NodeId>, |
| 574 | target: GraphNode<NodeId>, |
| 575 | ) -> bool { |
| 576 | if start == target { |
| 577 | return true; |
| 578 | } |
| 579 | |
| 580 | let mut stack = vec![start]; |
| 581 | let mut seen = std::collections::HashSet::new(); |
| 582 | |
| 583 | while let Some(current) = stack.pop() { |
| 584 | if !seen.insert(current) { |
| 585 | continue; |
| 586 | } |
| 587 | |
| 588 | let edges = match txn.iter_forward(current, true) { |
| 589 | Ok(edges) => edges, |
| 590 | Err(_) => continue, |
| 591 | }; |
| 592 | |
| 593 | for edge in edges { |
| 594 | if edge.kind.is_pseudo() { |
| 595 | continue; |
| 596 | } |
| 597 | |
| 598 | let next = match txn.find_block(edge.dest) { |
| 599 | Ok(next) => next, |
| 600 | Err(_) => continue, |
| 601 | }; |
| 602 | |
| 603 | if !options.passes_filter(next.change) { |
| 604 | continue; |
| 605 | } |
| 606 | |
| 607 | if next == target { |
| 608 | return true; |
| 609 | } |
| 610 | |
| 611 | stack.push(next); |
| 612 | } |
| 613 | } |
| 614 | |
| 615 | false |
| 616 | } |
| 617 | |
| 618 | fn alive_graph_reaches(graph: &AliveGraph, from: VertexId, target: VertexId) -> bool { |
| 619 | if from == target { |
no test coverage detected