From 19d9912f7b0f55c719dae90ea7ce974a2271fd49 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 8 Dec 2020 17:42:24 +0000 Subject: [PATCH] only remove tokens for this game! Signed-off-by: Ian Jackson --- src/global.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/global.rs b/src/global.rs index 1f4ff584..184c25e1 100644 --- a/src/global.rs +++ b/src/global.rs @@ -808,10 +808,11 @@ impl<'ig> InstanceGuard<'ig> { fn tokens_deregister_for_id bool > (&mut self, oldid: F) { let mut tokens = AccessId::global_tokens(PRIVATE_Y).write().unwrap(); - tokens.retain(|k,v| { - let remove = oldid(v.ident); - if remove { Id::tokens_registry(self, PRIVATE_Y).tr.remove(k); } - !remove + tokens.retain(|k,v| if_chain! { + if oldid(v.ident); + if Id::tokens_registry(self, PRIVATE_Y).tr.remove(k); + then { false } + else { true } }); } -- 2.30.2