Skip to content

Commit

Permalink
perf: Don't have generalize_type be N^2
Browse files Browse the repository at this point in the history
Well... looks like a remnant from an earlier version where the method
looked differently.
  • Loading branch information
Marwes committed Dec 9, 2018
1 parent 7a07da1 commit 16ba38a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions check/src/typecheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2891,10 +2891,7 @@ impl<'a, 'b> TypeGeneralizer<'a, 'b> {
}

fn generalize_type(&mut self, typ: &ArcType) -> Option<ArcType> {
let replacement = self
.subs
.replace_variable(typ)
.map(|t| self.generalize_type(&t).unwrap_or(t));
let replacement = self.subs.replace_variable(typ);
let mut typ = typ;
if let Some(ref t) = replacement {
typ = t;
Expand Down

0 comments on commit 16ba38a

Please sign in to comment.