@@ -12,10 +12,8 @@ use qsc_hir::{
12
12
ty:: { Arrow , FunctorSetValue , Ty } ,
13
13
visit:: { self , Visitor } ,
14
14
} ;
15
- use std:: {
16
- collections:: { HashMap , HashSet } ,
17
- iter,
18
- } ;
15
+ use rustc_hash:: { FxHashMap , FxHashSet } ;
16
+ use std:: iter;
19
17
20
18
pub ( super ) struct Lambda {
21
19
pub ( super ) kind : CallableKind ,
@@ -30,8 +28,8 @@ pub(super) struct PartialApp {
30
28
}
31
29
32
30
struct VarFinder {
33
- bindings : HashSet < NodeId > ,
34
- uses : HashSet < NodeId > ,
31
+ bindings : FxHashSet < NodeId > ,
32
+ uses : FxHashSet < NodeId > ,
35
33
}
36
34
37
35
impl VarFinder {
@@ -63,7 +61,7 @@ impl Visitor<'_> for VarFinder {
63
61
}
64
62
65
63
struct VarReplacer < ' a > {
66
- substitutions : & ' a HashMap < NodeId , NodeId > ,
64
+ substitutions : & ' a FxHashMap < NodeId , NodeId > ,
67
65
}
68
66
69
67
impl VarReplacer < ' _ > {
@@ -91,14 +89,14 @@ pub(super) fn lift(
91
89
span : Span ,
92
90
) -> ( Vec < NodeId > , CallableDecl ) {
93
91
let mut finder = VarFinder {
94
- bindings : HashSet :: new ( ) ,
95
- uses : HashSet :: new ( ) ,
92
+ bindings : FxHashSet :: default ( ) ,
93
+ uses : FxHashSet :: default ( ) ,
96
94
} ;
97
95
finder. visit_pat ( & lambda. input ) ;
98
96
finder. visit_expr ( & lambda. body ) ;
99
97
100
98
let free_vars = finder. free_vars ( ) ;
101
- let substitutions: HashMap < _ , _ > = free_vars
99
+ let substitutions: FxHashMap < _ , _ > = free_vars
102
100
. iter ( )
103
101
. map ( |& id| ( id, assigner. next_node ( ) ) )
104
102
. collect ( ) ;
0 commit comments