From 1244143838ed56fcc7d257ef6f9288d38754f60d Mon Sep 17 00:00:00 2001 From: Markus Westerlind Date: Sat, 17 Aug 2019 08:16:39 +0200 Subject: [PATCH] perf(check): Use RefCell::get_mut when possible --- check/src/substitution.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check/src/substitution.rs b/check/src/substitution.rs index fd0438c787..25652292e8 100644 --- a/check/src/substitution.rs +++ b/check/src/substitution.rs @@ -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()); } @@ -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)); }