|
1 | 1 | use std::{cmp::Ordering, collections::hash_map::Entry};
|
2 | 2 |
|
3 | 3 | use anyhow::{Context, Result, bail};
|
4 |
| -use roaring::RoaringBitmap; |
5 | 4 | use rustc_hash::{FxHashMap, FxHashSet};
|
6 | 5 | use tracing::Instrument;
|
7 | 6 | use turbo_tasks::{
|
@@ -166,26 +165,12 @@ pub async fn compute_merged_modules(module_graph: Vc<ModuleGraph>) -> Result<Vc<
|
166 | 165 | let idx = next_index;
|
167 | 166 | next_index += 1;
|
168 | 167 |
|
169 |
| - match module_merged_groups.entry(module) { |
170 |
| - Entry::Occupied(mut entry) => { |
171 |
| - let current = entry.get_mut(); |
172 |
| - if !current.contains(idx) { |
173 |
| - // Mark and continue traversal because modified |
174 |
| - current.insert(idx); |
175 |
| - GraphTraversalAction::Continue |
176 |
| - } else { |
177 |
| - // Unchanged, no need to forward to children |
178 |
| - GraphTraversalAction::Skip |
179 |
| - } |
180 |
| - } |
181 |
| - Entry::Vacant(entry) => { |
182 |
| - // First visit |
183 |
| - entry.insert(RoaringBitmapWrapper( |
184 |
| - RoaringBitmap::from_sorted_iter(std::iter::once(idx)) |
185 |
| - .unwrap(), |
186 |
| - )); |
187 |
| - GraphTraversalAction::Continue |
188 |
| - } |
| 168 | + if module_merged_groups.entry(module).or_default().insert(idx) { |
| 169 | + // Mark and continue traversal because modified (or first visit) |
| 170 | + GraphTraversalAction::Continue |
| 171 | + } else { |
| 172 | + // Unchanged, no need to forward to children |
| 173 | + GraphTraversalAction::Skip |
189 | 174 | }
|
190 | 175 | } else {
|
191 | 176 | // Already visited and assigned a new group, no need to forward to
|
|
0 commit comments