Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Commit

Permalink
Inline some stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptibell committed Jan 31, 2024
1 parent 013537b commit a5d411e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/result_map.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::inline_always)]

use std::{
cell::RefCell,
collections::{HashMap, HashSet},
Expand All @@ -20,16 +22,19 @@ impl ThreadResultMap {
}
}

#[inline(always)]
pub fn track(&self, id: ThreadId) {
self.tracked.borrow_mut().insert(id);
}

#[inline(always)]
pub fn is_tracked(&self, id: ThreadId) -> bool {
self.tracked.borrow().contains(&id)
}

#[inline(always)]
pub fn insert(&self, id: ThreadId, result: ThreadResult) {
assert!(self.is_tracked(id), "Thread must be tracked");
debug_assert!(self.is_tracked(id), "Thread must be tracked");
self.inner.borrow_mut().insert(id, result);
}

Expand Down

0 comments on commit a5d411e

Please sign in to comment.