Auto merge of #84805 - Mark-Simulacrum:no-dup-extend, r=cjgillot
Avoid generating QueryMap::extend for each key type Should be a small win on compile times for rustc_query_impl, where this ends up getting codegen'd.
This commit is contained in:
commit
3a1cd0ed36
1 changed files with 5 additions and 8 deletions
|
@ -125,18 +125,15 @@ where
|
|||
// We use try_lock_shards here since we are called from the
|
||||
// deadlock handler, and this shouldn't be locked.
|
||||
let shards = self.shards.try_lock_shards()?;
|
||||
let shards = shards.iter().enumerate();
|
||||
jobs.extend(shards.flat_map(|(shard_id, shard)| {
|
||||
shard.active.iter().filter_map(move |(k, v)| {
|
||||
for (shard_id, shard) in shards.iter().enumerate() {
|
||||
for (k, v) in shard.active.iter() {
|
||||
if let QueryResult::Started(ref job) = *v {
|
||||
let id = QueryJobId::new(job.id, shard_id, kind);
|
||||
let info = QueryInfo { span: job.span, query: make_query(tcx, k.clone()) };
|
||||
Some((id, QueryJobInfo { info, job: job.clone() }))
|
||||
} else {
|
||||
None
|
||||
jobs.insert(id, QueryJobInfo { info, job: job.clone() });
|
||||
}
|
||||
})
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
Some(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue