@@ -457,8 +457,7 @@ impl Visit for Collect {
457
457
) ;
458
458
self
459
459
. exports_locals
460
- . entry ( id ! ( class. ident) )
461
- . or_insert_with ( || class. ident . sym . clone ( ) ) ;
460
+ . insert ( id ! ( class. ident) , class. ident . sym . clone ( ) ) ;
462
461
}
463
462
Decl :: Fn ( func) => {
464
463
self . exports . insert (
@@ -472,8 +471,7 @@ impl Visit for Collect {
472
471
) ;
473
472
self
474
473
. exports_locals
475
- . entry ( id ! ( func. ident) )
476
- . or_insert_with ( || func. ident . sym . clone ( ) ) ;
474
+ . insert ( id ! ( func. ident) , func. ident . sym . clone ( ) ) ;
477
475
}
478
476
Decl :: Var ( var) => {
479
477
for decl in & var. decls {
@@ -503,10 +501,7 @@ impl Visit for Collect {
503
501
is_esm : true ,
504
502
} ,
505
503
) ;
506
- self
507
- . exports_locals
508
- . entry ( id ! ( ident) )
509
- . or_insert_with ( || js_word ! ( "default" ) ) ;
504
+ self . exports_locals . insert ( id ! ( ident) , js_word ! ( "default" ) ) ;
510
505
} else {
511
506
self . exports . insert (
512
507
js_word ! ( "default" ) ,
@@ -530,10 +525,7 @@ impl Visit for Collect {
530
525
is_esm : true ,
531
526
} ,
532
527
) ;
533
- self
534
- . exports_locals
535
- . entry ( id ! ( ident) )
536
- . or_insert_with ( || js_word ! ( "default" ) ) ;
528
+ self . exports_locals . insert ( id ! ( ident) , js_word ! ( "default" ) ) ;
537
529
} else {
538
530
self . exports . insert (
539
531
js_word ! ( "default" ) ,
@@ -597,8 +589,7 @@ impl Visit for Collect {
597
589
) ;
598
590
self
599
591
. exports_locals
600
- . entry ( id ! ( node. id) )
601
- . or_insert_with ( || node. id . sym . clone ( ) ) ;
592
+ . insert ( id ! ( node. id) , node. id . sym . clone ( ) ) ;
602
593
}
603
594
604
595
if self . in_assign && node. id . ctxt . has_mark ( self . global_mark ) {
@@ -623,8 +614,7 @@ impl Visit for Collect {
623
614
) ;
624
615
self
625
616
. exports_locals
626
- . entry ( id ! ( node. key) )
627
- . or_insert_with ( || node. key . sym . clone ( ) ) ;
617
+ . insert ( id ! ( node. key) , node. key . sym . clone ( ) ) ;
628
618
}
629
619
630
620
if self . in_assign && node. key . ctxt . has_mark ( self . global_mark ) {
@@ -700,7 +690,8 @@ impl Visit for Collect {
700
690
. entry ( id ! ( ident) )
701
691
. or_default ( )
702
692
. push ( node. span ) ;
703
- } else if self . imports . contains_key ( & id ! ( ident) ) {
693
+ }
694
+ if self . imports . contains_key ( & id ! ( ident) ) {
704
695
self . used_imports . insert ( id ! ( ident) ) ;
705
696
}
706
697
return ;
0 commit comments