mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 15:54:15 +00:00
Simplify
This commit is contained in:
parent
e83a2912b8
commit
9970dd316b
@ -173,7 +173,6 @@ pub fn main_loop(ws_roots: Vec<PathBuf>, config: Config, connection: Connection)
|
||||
};
|
||||
|
||||
loop_state.roots_total = world_state.vfs.read().n_roots();
|
||||
loop_state.roots_scanned = 0;
|
||||
|
||||
let pool = ThreadPool::default();
|
||||
let (task_sender, task_receiver) = unbounded::<Task>();
|
||||
@ -400,10 +399,12 @@ fn loop_turn(
|
||||
}
|
||||
|
||||
let max_in_flight_libs = pool.max_count().saturating_sub(2).max(1);
|
||||
while loop_state.in_flight_libraries < max_in_flight_libs
|
||||
&& !loop_state.pending_libraries.is_empty()
|
||||
{
|
||||
let (root, files) = loop_state.pending_libraries.pop().unwrap();
|
||||
while loop_state.in_flight_libraries < max_in_flight_libs {
|
||||
let (root, files) = match loop_state.pending_libraries.pop() {
|
||||
Some(it) => it,
|
||||
None => break,
|
||||
};
|
||||
|
||||
loop_state.in_flight_libraries += 1;
|
||||
let sender = libdata_sender.clone();
|
||||
pool.execute(move || {
|
||||
|
Loading…
Reference in New Issue
Block a user