File tree 2 files changed +9
-6
lines changed
crates/swc_ecma_transforms_base/src/resolver
2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ swc_ecma_transforms_base : minor
3
+ swc_core : minor
4
+ ---
5
+
6
+ perf: Remove some vector allocations in resolver
Original file line number Diff line number Diff line change @@ -536,8 +536,7 @@ impl VisitMut for Resolver<'_> {
536
536
. params
537
537
. iter ( )
538
538
. filter ( |p| !p. is_rest ( ) )
539
- . flat_map ( find_pat_ids)
540
- . collect :: < Vec < Id > > ( ) ;
539
+ . flat_map ( find_pat_ids :: < _ , Id > ) ;
541
540
542
541
for id in params {
543
542
child. current . declared_symbols . insert ( id. 0 , DeclKind :: Param ) ;
@@ -722,8 +721,7 @@ impl VisitMut for Resolver<'_> {
722
721
ParamOrTsParamProp :: TsParamProp ( _) => false ,
723
722
ParamOrTsParamProp :: Param ( p) => !p. pat . is_rest ( ) ,
724
723
} )
725
- . flat_map ( find_pat_ids)
726
- . collect :: < Vec < Id > > ( ) ;
724
+ . flat_map ( find_pat_ids :: < _ , Id > ) ;
727
725
728
726
for id in params {
729
727
child. current . declared_symbols . insert ( id. 0 , DeclKind :: Param ) ;
@@ -877,8 +875,7 @@ impl VisitMut for Resolver<'_> {
877
875
. params
878
876
. iter ( )
879
877
. filter ( |p| !p. pat . is_rest ( ) )
880
- . flat_map ( find_pat_ids)
881
- . collect :: < Vec < Id > > ( ) ;
878
+ . flat_map ( find_pat_ids :: < _ , Id > ) ;
882
879
883
880
for id in params {
884
881
self . current . declared_symbols . insert ( id. 0 , DeclKind :: Param ) ;
You can’t perform that action at this time.
0 commit comments