Skip to content

Commit a55cde5

Browse files
Cleanup code_lock.rs
1 parent 9ad7a8f commit a55cde5

1 file changed

Lines changed: 0 additions & 10 deletions

File tree

serial_test/src/code_lock.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ impl LockMap {
2727
self.inner.lock().unwrap().get(key).cloned().map(ValueRef)
2828
}
2929

30-
pub fn contains(&self, key: &str) -> bool {
31-
self.inner.lock().unwrap().contains_key(key)
32-
}
33-
3430
fn get_or_insert(
3531
&self,
3632
key: &str,
@@ -155,12 +151,6 @@ impl UniqueReentrantMutex {
155151
}
156152

157153
pub(crate) fn check_new_key(name: &str) {
158-
// Check if a new key is needed. Just need a read lock, which can be done in sync with everyone else
159-
if global_locks().contains(name) {
160-
return;
161-
};
162-
163-
// This is the rare path, which avoids the multi-writer situation mostly
164154
global_locks().get_or_insert(name, || UniqueReentrantMutex::new_mutex(name));
165155
}
166156

0 commit comments

Comments
 (0)