From 7d0c1f5787a9e96fee48486c6e42a7ced42dc2f7 Mon Sep 17 00:00:00 2001 From: Folkert Date: Sun, 25 Jul 2021 20:50:40 +0200 Subject: [PATCH] remove unneeded `contains` --- compiler/mono/src/borrow.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/compiler/mono/src/borrow.rs b/compiler/mono/src/borrow.rs index d0c3aad97c..e9955f837a 100644 --- a/compiler/mono/src/borrow.rs +++ b/compiler/mono/src/borrow.rs @@ -337,10 +337,9 @@ impl<'a> BorrowInfState<'a> { pub fn own_var(&mut self, x: Symbol) { let current = self.owned.get_mut(&self.current_proc).unwrap(); - if current.contains(&x) { - // do nothing - } else { - current.insert(x); + if current.insert(x) { + // entered if key was not yet present. If so, the set is modified, + // hence we set this flag self.modified = true; } }