Skip to content

Commit 3a1cd0e

Browse files
committed
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.
2 parents 6d4e3c1 + 61fd56f commit 3a1cd0e

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

compiler/rustc_query_system/src/query/plumbing.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -125,18 +125,15 @@ where
125125
// We use try_lock_shards here since we are called from the
126126
// deadlock handler, and this shouldn't be locked.
127127
let shards = self.shards.try_lock_shards()?;
128-
let shards = shards.iter().enumerate();
129-
jobs.extend(shards.flat_map(|(shard_id, shard)| {
130-
shard.active.iter().filter_map(move |(k, v)| {
128+
for (shard_id, shard) in shards.iter().enumerate() {
129+
for (k, v) in shard.active.iter() {
131130
if let QueryResult::Started(ref job) = *v {
132131
let id = QueryJobId::new(job.id, shard_id, kind);
133132
let info = QueryInfo { span: job.span, query: make_query(tcx, k.clone()) };
134-
Some((id, QueryJobInfo { info, job: job.clone() }))
135-
} else {
136-
None
133+
jobs.insert(id, QueryJobInfo { info, job: job.clone() });
137134
}
138-
})
139-
}));
135+
}
136+
}
140137

141138
Some(())
142139
}

0 commit comments

Comments
 (0)