Skip to content

Commit

Permalink
perf(check): Use RefCell::get_mut when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
Marwes committed Aug 31, 2019
1 parent f3d4203 commit 1244143
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions check/src/substitution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ where

pub fn replace(&mut self, var: u32, t: T) {
debug_assert!(t.get_id() != Some(var));
self.types_undo.borrow_mut().push(var);
self.types_undo.get_mut().push(var);
self.types.insert(var as usize, t.into());
}

Expand Down Expand Up @@ -333,7 +333,7 @@ where
/// Assumes that no variables unified with anything (but variables < level may exist)
pub fn clear_from(&mut self, level: u32) {
self.union = RefCell::new(ena::unify::InPlaceUnificationTable::new());
let mut u = self.union.borrow_mut();
let u = self.union.get_mut();
for var in 0..level {
u.new_key(Level(var));
}
Expand Down

0 comments on commit 1244143

Please sign in to comment.