diff options
| author | bors <bors@rust-lang.org> | 2018-09-18 03:52:39 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-09-18 03:52:39 +0000 |
| commit | b80cb47889e0ad9400b6708ce2b4c4b364b71982 (patch) | |
| tree | ca70c0600050ce729db297996e4b4a701c0dcaad /src/librustc_data_structures/graph/implementation | |
| parent | 2224a42c353636db6ee53cc3f9b1a968e9d9c1f6 (diff) | |
| parent | 53589b7e4ea36927f2f58c30a23df427f3560f06 (diff) | |
| download | rust-b80cb47889e0ad9400b6708ce2b4c4b364b71982.tar.gz rust-b80cb47889e0ad9400b6708ce2b4c4b364b71982.zip | |
Auto merge of #54286 - nnethercote:BitSet, r=pnkfelix
Merge `bitvec.rs` and `indexed_set.rs` Because it's not good to have two separate implementations. Also, I will combine the best parts of each to improve NLL memory usage on some benchmarks significantly.
Diffstat (limited to 'src/librustc_data_structures/graph/implementation')
| -rw-r--r-- | src/librustc_data_structures/graph/implementation/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librustc_data_structures/graph/implementation/mod.rs b/src/librustc_data_structures/graph/implementation/mod.rs index baac7565868..c31321fa374 100644 --- a/src/librustc_data_structures/graph/implementation/mod.rs +++ b/src/librustc_data_structures/graph/implementation/mod.rs @@ -30,7 +30,7 @@ //! the field `next_edge`). Each of those fields is an array that should //! be indexed by the direction (see the type `Direction`). -use bitvec::BitArray; +use bit_set::BitSet; use std::fmt::Debug; use std::usize; use snapshot_vec::{SnapshotVec, SnapshotVecDelegate}; @@ -266,7 +266,7 @@ impl<N: Debug, E: Debug> Graph<N, E> { direction: Direction, entry_node: NodeIndex, ) -> Vec<NodeIndex> { - let mut visited = BitArray::new(self.len_nodes()); + let mut visited = BitSet::new_empty(self.len_nodes()); let mut stack = vec![]; let mut result = Vec::with_capacity(self.len_nodes()); let mut push_node = |stack: &mut Vec<_>, node: NodeIndex| { @@ -348,7 +348,7 @@ where { graph: &'g Graph<N, E>, stack: Vec<NodeIndex>, - visited: BitArray<usize>, + visited: BitSet<usize>, direction: Direction, } @@ -358,7 +358,7 @@ impl<'g, N: Debug, E: Debug> DepthFirstTraversal<'g, N, E> { start_node: NodeIndex, direction: Direction, ) -> Self { - let mut visited = BitArray::new(graph.len_nodes()); + let mut visited = BitSet::new_empty(graph.len_nodes()); visited.insert(start_node.node_id()); DepthFirstTraversal { graph, |
