Speed up vector removal

This commit is contained in:
Wildan M
2026-04-29 22:54:20 +07:00
parent 00232b456c
commit 3914801f1e
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -111,7 +111,7 @@ impl WaitCondition {
.iter()
.position(|c| Weak::as_ptr(c) == Arc::as_ptr(&current_context_ref))
{
contexts.remove(index);
contexts.swap_remove(index);
waited = false;
}
}