Skip to content

Commit

Permalink
perf(check): Only do one lookup/insertion on the implicit definition map
Browse files Browse the repository at this point in the history
  • Loading branch information
Marwes committed Aug 31, 2019
1 parent a9c965b commit 0ea13ff
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions check/src/implicits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,6 @@ impl ImplicitBindings {
path: &[TypedIdent<Symbol, RcType>],
typ: &RcType,
) {
if let Some(definition) = definition {
self.definitions.insert(definition.clone(), ());
}

let level = Level(self.partition_insertions.len().try_into().unwrap());

self.partition
Expand Down Expand Up @@ -770,7 +766,11 @@ impl<'a> ImplicitResolver<'a> {
// add it again to prevent ambiguities
if let Some(metadata) = metadata {
if let Some(ref definition) = metadata.definition {
if self.implicit_bindings.definitions.contains_key(definition) {
if self
.implicit_bindings
.definitions
.insert(definition.clone(), ())
{
return;
}
}
Expand Down

0 comments on commit 0ea13ff

Please sign in to comment.