diff options
| author | Rémy Rakic <remy.rakic+github@gmail.com> | 2025-01-07 15:19:05 +0000 |
|---|---|---|
| committer | Rémy Rakic <remy.rakic+github@gmail.com> | 2025-01-11 11:34:01 +0000 |
| commit | a13354bea05968799a5be5521691322274fa6a9e (patch) | |
| tree | e8e27ef15e991c493c152623adefa78ec0f64eab /compiler/rustc_data_structures/src/graph/implementation/mod.rs | |
| parent | 7e4077d06fc073442c567d58885b47ed2c5121b8 (diff) | |
| download | rust-a13354bea05968799a5be5521691322274fa6a9e.tar.gz rust-a13354bea05968799a5be5521691322274fa6a9e.zip | |
rename `BitSet` to `DenseBitSet`
This should make it clearer that this bitset is dense, with the advantages and disadvantages that it entails.
Diffstat (limited to 'compiler/rustc_data_structures/src/graph/implementation/mod.rs')
| -rw-r--r-- | compiler/rustc_data_structures/src/graph/implementation/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_data_structures/src/graph/implementation/mod.rs b/compiler/rustc_data_structures/src/graph/implementation/mod.rs index 43fdfe6ee0d..7724e9347d8 100644 --- a/compiler/rustc_data_structures/src/graph/implementation/mod.rs +++ b/compiler/rustc_data_structures/src/graph/implementation/mod.rs @@ -22,7 +22,7 @@ use std::fmt::Debug; -use rustc_index::bit_set::BitSet; +use rustc_index::bit_set::DenseBitSet; use tracing::debug; #[cfg(test)] @@ -214,7 +214,7 @@ impl<N: Debug, E: Debug> Graph<N, E> { direction: Direction, entry_node: NodeIndex, ) -> Vec<NodeIndex> { - let mut visited = BitSet::new_empty(self.len_nodes()); + let mut visited = DenseBitSet::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| { @@ -287,7 +287,7 @@ impl<'g, N: Debug, E: Debug> Iterator for AdjacentEdges<'g, N, E> { pub struct DepthFirstTraversal<'g, N, E> { graph: &'g Graph<N, E>, stack: Vec<NodeIndex>, - visited: BitSet<usize>, + visited: DenseBitSet<usize>, direction: Direction, } @@ -297,7 +297,7 @@ impl<'g, N: Debug, E: Debug> DepthFirstTraversal<'g, N, E> { start_node: NodeIndex, direction: Direction, ) -> Self { - let mut visited = BitSet::new_empty(graph.len_nodes()); + let mut visited = DenseBitSet::new_empty(graph.len_nodes()); visited.insert(start_node.node_id()); DepthFirstTraversal { graph, stack: vec![start_node], visited, direction } } |
