File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/librustc_data_structures/graph/dominators Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -38,13 +38,13 @@ pub fn dominators_given_rpo<G: ControlFlowGraph>(
3838
3939 // compute the post order index (rank) for each node
4040 let mut post_order_rank: IndexVec < G :: Node , usize > =
41- IndexVec :: from_elem_n ( usize :: default ( ) , graph. num_nodes ( ) ) ;
41+ ( 0 .. graph. num_nodes ( ) ) . map ( |_| 0 ) . collect ( ) ;
4242 for ( index, node) in rpo. iter ( ) . rev ( ) . cloned ( ) . enumerate ( ) {
4343 post_order_rank[ node] = index;
4444 }
4545
4646 let mut immediate_dominators: IndexVec < G :: Node , Option < G :: Node > > =
47- IndexVec :: from_elem_n ( Option :: default ( ) , graph. num_nodes ( ) ) ;
47+ ( 0 .. graph. num_nodes ( ) ) . map ( |_| None ) . collect ( ) ;
4848 immediate_dominators[ start_node] = Some ( start_node) ;
4949
5050 let mut changed = true ;
You can’t perform that action at this time.
0 commit comments