Skip to content

Commit 4f4762f

Browse files
committed
perf: avoid prepared connection slice allocation
1 parent a3d6629 commit 4f4762f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub(crate) type DependenciesBlockIdentifierMap<V> =
3333
pub(crate) type DependenciesBlockIdentifierSet =
3434
std::collections::HashSet<DependenciesBlockIdentifier, BuildHasherDefault<FxHasher>>;
3535

36-
type ConnectionIdList = Arc<[DependencyId]>;
36+
type ConnectionIdList = Arc<Vec<DependencyId>>;
3737
type PreparedBlockConnectionMap = Vec<PreparedBlockConnection>;
3838
type BlockConnectionMap =
3939
DependenciesBlockIdentifierMap<Arc<Vec<(ModuleIdentifier, ConnectionState, ConnectionIdList)>>>;
@@ -96,7 +96,7 @@ fn finalize_prepared_connection_map(
9696
.map(|connection| PreparedBlockConnection {
9797
block: connection.block,
9898
module: connection.module,
99-
connections: Arc::from(connection.connections.into_boxed_slice()),
99+
connections: Arc::new(connection.connections),
100100
})
101101
.collect()
102102
}

0 commit comments

Comments
 (0)