File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
sway-core/src/semantic_analysis/namespace Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -316,9 +316,9 @@ pub struct LexicalScope {
316
316
317
317
/// The set of items that exist within some lexical scope via declaration or importing.
318
318
pub struct Items {
319
- /// An ordered map from `Ident`s to their associated parsed declarations.
319
+ /// A map from `Ident`s to their associated parsed declarations.
320
320
pub (crate ) parsed_symbols : ParsedSymbolMap ,
321
- /// An ordered map from `Ident`s to their associated typed declarations.
321
+ /// A map from `Ident`s to their associated typed declarations.
322
322
pub (crate ) symbols : SymbolMap ,
323
323
...
324
324
}
Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ impl ResolvedFunctionDecl {
36
36
}
37
37
}
38
38
39
+ // The following types were using im::OrdMap but it revealed to be
40
+ // much slower than using HashMap and sorting on iterationn.
39
41
pub ( super ) type SymbolMap = HashMap < Ident , ResolvedDeclaration > ;
40
42
pub ( super ) type SymbolUniqueMap = HashMap < IdentUnique , ResolvedDeclaration > ;
41
43
@@ -82,10 +84,10 @@ pub struct LexicalScope {
82
84
/// The set of items that exist within some lexical scope via declaration or importing.
83
85
#[ derive( Clone , Debug , Default ) ]
84
86
pub struct Items {
85
- /// An ordered map from `Ident`s to their associated declarations.
87
+ /// An map from `Ident`s to their associated declarations.
86
88
pub ( crate ) symbols : SymbolMap ,
87
89
88
- /// An ordered map from `IdentUnique`s to their associated declarations.
90
+ /// An map from `IdentUnique`s to their associated declarations.
89
91
/// This uses an Arc<RwLock<SymbolUniqueMap>> so it is shared between all
90
92
/// Items clones. This is intended so we can keep the symbols of previous
91
93
/// lexical scopes while collecting_unifications scopes.
You can’t perform that action at this time.
0 commit comments