We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df9093d commit 120ba6cCopy full SHA for 120ba6c
src/dynamic_set.rs
@@ -87,13 +87,11 @@ impl Set {
87
}
88
89
pub(crate) fn remove(&self, ptr: *mut Entry) {
90
- let bucket_index = {
91
- let value: &Entry = unsafe { &*ptr };
92
- debug_assert!(value.ref_count.load(SeqCst) == 0);
93
- (value.hash & BUCKET_MASK) as usize
94
- };
+ let value: &Entry = unsafe { &*ptr };
+ let bucket_index = (value.hash & BUCKET_MASK) as usize;
95
96
let mut linked_list = self.buckets[bucket_index].lock();
+ debug_assert!(value.ref_count.load(SeqCst) == 0);
97
let mut current: &mut Option<Box<Entry>> = &mut linked_list;
98
99
while let Some(entry_ptr) = current.as_mut() {
0 commit comments