mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-01-11 05:54:30 +01:00
adds a comment about the safety of an operation
This commit is contained in:
parent
2e36f069c2
commit
55df9daaa0
@ -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() });
|
||||
|
Loading…
x
Reference in New Issue
Block a user