adds a comment about the safety of an operation

This commit is contained in:
Tamo 2024-03-26 19:34:55 +01:00
parent 2e36f069c2
commit 55df9daaa0

View File

@ -72,6 +72,7 @@ impl SearchQueue {
_ = search_finished.recv() => {
searches_running = searches_running.saturating_sub(1);
if !queue.is_empty() {
// Can't panic: the queue wasn't empty thus the range isn't empty.
let remove = rng.gen_range(0..queue.len());
let channel = queue.swap_remove(remove);
let _ = channel.send(Permit { sender: sender.clone() });