mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-25 01:34:02 +00:00
managed for small batch size edge case in semantic search
This commit is contained in:
parent
89bbcdfa4f
commit
5c48729c7c
1 changed files with 6 additions and 1 deletions
|
@ -721,7 +721,12 @@ impl SemanticIndex {
|
|||
)?;
|
||||
|
||||
let batch_n = cx.background().num_cpus();
|
||||
let batch_size = file_ids.clone().len() / batch_n;
|
||||
let ids_len = file_ids.clone().len();
|
||||
let batch_size = if ids_len <= batch_n {
|
||||
ids_len
|
||||
} else {
|
||||
ids_len / batch_n
|
||||
};
|
||||
|
||||
let mut result_tasks = Vec::new();
|
||||
for batch in file_ids.chunks(batch_size) {
|
||||
|
|
Loading…
Reference in a new issue