11use std:: {
22 borrow:: Cow ,
3- collections:: { BTreeMap , hash_map :: Entry } ,
3+ collections:: BTreeMap ,
44 fmt:: Debug ,
55 hash:: { BuildHasherDefault , Hasher } ,
66 sync:: { Arc , LazyLock } ,
@@ -22,7 +22,8 @@ use rspack_sources::{
2222 BoxSource , CachedSource , ConcatSource , RawStringSource , ReplaceSource , Source , SourceExt ,
2323} ;
2424use rspack_util:: {
25- SpanExt , ext:: DynHash , itoa, json_stringify, source_map:: SourceMapKind , swc:: join_atom,
25+ SpanExt , ext:: DynHash , fx_hash:: FxIndexMap , itoa, json_stringify, source_map:: SourceMapKind ,
26+ swc:: join_atom,
2627} ;
2728use rustc_hash:: { FxHashMap as HashMap , FxHashSet as HashSet , FxHasher } ;
2829use swc_core:: {
@@ -204,7 +205,7 @@ pub struct ConcatenatedModuleInfo {
204205 pub global_scope_ident : Vec < ConcatenatedModuleIdent > ,
205206 pub idents : Vec < ConcatenatedModuleIdent > ,
206207 pub all_used_names : HashSet < Atom > ,
207- pub binding_to_ref : HashMap < ( Atom , SyntaxContext ) , Vec < ConcatenatedModuleIdent > > ,
208+ pub binding_to_ref : FxIndexMap < ( Atom , SyntaxContext ) , Vec < ConcatenatedModuleIdent > > ,
208209
209210 pub public_path_auto_replacement : Option < bool > ,
210211 pub static_url_replacement : bool ,
@@ -217,7 +218,7 @@ impl ConcatenatedModuleInfo {
217218 }
218219
219220 if atom. as_str ( ) == "default" {
220- return self . internal_names . get ( & DEFAULT_EXPORT_ATOM ) ;
221+ return self . internal_names . get ( & * DEFAULT_EXPORT_ATOM ) ;
221222 }
222223
223224 if let Some ( name) = & self . namespace_export_symbol
@@ -2319,15 +2320,15 @@ impl ConcatenatedModule {
23192320 }
23202321 module_info. all_used_names = all_used_names;
23212322
2322- let mut binding_to_ref: HashMap < ( Atom , SyntaxContext ) , Vec < ConcatenatedModuleIdent > > =
2323- HashMap :: default ( ) ;
2323+ let mut binding_to_ref: FxIndexMap < ( Atom , SyntaxContext ) , Vec < ConcatenatedModuleIdent > > =
2324+ Default :: default ( ) ;
23242325
23252326 for ident in module_info. idents . iter ( ) {
23262327 match binding_to_ref. entry ( ( ident. id . sym . clone ( ) , ident. id . ctxt ) ) {
2327- Entry :: Occupied ( mut occ) => {
2328+ indexmap :: map :: Entry :: Occupied ( mut occ) => {
23282329 occ. get_mut ( ) . push ( ident. clone ( ) ) ;
23292330 }
2330- Entry :: Vacant ( vac) => {
2331+ indexmap :: map :: Entry :: Vacant ( vac) => {
23312332 vac. insert ( vec ! [ ident. clone( ) ] ) ;
23322333 }
23332334 } ;
0 commit comments