Speed up vector removal
This commit is contained in:
@@ -68,7 +68,7 @@ pub fn trigger(token: &mut CleanLockToken) {
|
||||
};
|
||||
|
||||
if trigger {
|
||||
registry.remove(i).unwrap()
|
||||
registry.swap_remove_back(i).unwrap()
|
||||
} else {
|
||||
i += 1;
|
||||
continue;
|
||||
|
||||
@@ -111,7 +111,7 @@ impl WaitCondition {
|
||||
.iter()
|
||||
.position(|c| Weak::as_ptr(c) == Arc::as_ptr(¤t_context_ref))
|
||||
{
|
||||
contexts.remove(index);
|
||||
contexts.swap_remove(index);
|
||||
waited = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user