Skip to content

Commit f177403

Browse files
committed
fix: update
1 parent 5bee7d7 commit f177403

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/rolldown/src/stages/generate_stage/compute_cross_chunk_links.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type ChunkMetaImports = IndexVec<ChunkId, FxHashSet<SymbolRef>>;
1818
type ChunkMetaImportsForExternalModules =
1919
IndexVec<ChunkId, FxHashMap<ExternalModuleId, Vec<NamedImport>>>;
2020
type ChunkMetaExports = IndexVec<ChunkId, FxHashSet<SymbolRef>>;
21-
type IndexCrossChunkImports = IndexVec<ChunkId, Vec<ChunkId>>;
21+
type IndexCrossChunkImports = IndexVec<ChunkId, FxHashSet<ChunkId>>;
2222
type IndexCrossChunkDynamicImports =
2323
IndexVec<ChunkId, IndexSet<ChunkId, BuildHasherDefault<FxHasher>>>;
2424

@@ -150,7 +150,7 @@ impl<'a> GenerateStage<'a> {
150150
FxHashMap<ChunkId, Vec<CrossChunkImportItem>>,
151151
> = index_vec![FxHashMap::<ChunkId, Vec<CrossChunkImportItem>>::default(); chunk_graph.chunks.len()];
152152
let mut index_cross_chunk_imports: IndexCrossChunkImports =
153-
index_vec![vec![]; chunk_graph.chunks.len()];
153+
index_vec![FxHashSet::default(); chunk_graph.chunks.len()];
154154
let mut index_cross_chunk_dynamic_imports: IndexCrossChunkDynamicImports =
155155
index_vec![IndexSet::default(); chunk_graph.chunks.len()];
156156

@@ -177,7 +177,7 @@ impl<'a> GenerateStage<'a> {
177177
});
178178
// Check if the import is from another chunk
179179
if chunk_id != importee_chunk_id {
180-
index_cross_chunk_imports[chunk_id].push(importee_chunk_id);
180+
index_cross_chunk_imports[chunk_id].insert(importee_chunk_id);
181181
let imports_from_other_chunks = &mut imports_from_other_chunks_vec[chunk_id];
182182
imports_from_other_chunks
183183
.entry(importee_chunk_id)

0 commit comments

Comments
 (0)