Browse Source

Group together thread info calls

pull/42/head
AzureMarker 3 years ago
parent
commit
88315aec61
No known key found for this signature in database
GPG Key ID: 47A133F3BF9D03D3
  1. 7
      ctru-rs/src/thread.rs

7
ctru-rs/src/thread.rs

@ -1040,7 +1040,10 @@ mod thread_info { @@ -1040,7 +1040,10 @@ mod thread_info {
}
pub fn set(thread: Thread) {
CTRU_THREAD_INFO.with(|c| assert!(c.borrow().is_none()));
CTRU_THREAD_INFO.with(move |c| *c.borrow_mut() = Some(ThreadInfo { thread }));
CTRU_THREAD_INFO.with(move |c| {
let mut thread_info = c.borrow_mut();
assert!(thread_info.is_none());
*thread_info = Some(ThreadInfo { thread });
});
}
}

Loading…
Cancel
Save