Only initialize what is used
This commit is contained in:
parent
f7534b566c
commit
3c1d792f49
2 changed files with 6 additions and 3 deletions
|
@ -85,6 +85,10 @@ pub struct Dominators<N: Idx> {
|
|||
}
|
||||
|
||||
impl<Node: Idx> Dominators<Node> {
|
||||
pub fn dummy() -> Self {
|
||||
Self { post_order_rank: IndexVec::new(), immediate_dominators: IndexVec::new() }
|
||||
}
|
||||
|
||||
pub fn is_reachable(&self, node: Node) -> bool {
|
||||
self.immediate_dominators[node].is_some()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue